]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow multiple command-line arguments to be logical &&
authorAlan T. DeKok <aland@freeradius.org>
Mon, 26 Oct 2015 13:11:43 +0000 (09:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 26 Oct 2015 13:59:32 +0000 (09:59 -0400)
scripts/raddebug

index 91e7d610ac06a7ca8378203654a5f608b9d05c64..f10b2913f8f512f187b45e85e5cebc68da213e0e 100755 (executable)
@@ -45,16 +45,31 @@ do
        ;;
   D)    extra="$extra -D $OPTARG"
        ;;
-  i)   condition="(Packet-Src-IP-Address == $OPTARG)"
+  i)    x="(Packet-Src-IP-Address == $OPTARG)"
+       if [ "$condition" = "" ]; then
+           condition="$x"
+       else
+         condition="$condition && $x"
+       fi
        ;;
-  I)   condition="(Packet-Src-IPv6-Address == $OPTARG)"
+  I)   x="(Packet-Src-IPv6-Address == $OPTARG)"
+       if [ "$condition" = "" ]; then
+           condition="$x"
+       else
+         condition="$condition && $x"
+       fi
        ;;
   f)   extra="$extra -f $OPTARG"
        ;;
   t)   timeout="$OPTARG"
        [ "$timeout" = "0" ] && timeout=1000000
        ;;
-  u)   condition="(User-Name == '$OPTARG')"
+  u)   x="(User-Name == '$OPTARG')"
+       if [ "$condition" = "" ]; then
+           condition="$x"
+       else
+         condition="$condition && $x"
+       fi
        ;;
   ?)   usage
        ;;