]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ifcfg: Quote left-hand side of [ ] expression
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Aug 2017 17:09:32 +0000 (19:09 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 18 Aug 2017 16:11:00 +0000 (09:11 -0700)
This prevents word-splitting and therefore leads to more accurate error
message in case 'grep -c' prints something other than a number.

Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/ifcfg

index 083d9df36742fe0bd7bdb6b395ace5297aa03709..30a2dc49816cdc96e1975ba30abb60ca02c3e77d 100644 (file)
--- a/ip/ifcfg
+++ b/ip/ifcfg
@@ -131,7 +131,7 @@ noarp=$?
 
 ip route add unreachable 224.0.0.0/24 >& /dev/null
 ip route add unreachable 255.255.255.255 >& /dev/null
-if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
+if [ "`ip link ls $dev | grep -c MULTICAST`" -ge 1 ]; then
   ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
 fi