From: Alan T. DeKok Date: Mon, 26 Oct 2015 13:11:43 +0000 (-0400) Subject: Allow multiple command-line arguments to be logical && X-Git-Tag: release_3_0_11~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da8fe10dd8fefecd340674fe6f0e01cb659955af;p=thirdparty%2Ffreeradius-server.git Allow multiple command-line arguments to be logical && --- diff --git a/scripts/raddebug b/scripts/raddebug index 91e7d610ac0..f10b2913f8f 100755 --- a/scripts/raddebug +++ b/scripts/raddebug @@ -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 ;;