Skip to contentSkip to conversation

40network: Fix the syntax to correct the judgment sentence

PATCH In review Minfei Huang 2 participants 2 messages Dec 1, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 40network: Fix the syntax to correct the judgment sentence

In the judgment sentence, it will print the following warning message, becasuse of lacking the blank on the left of ']'.

/lib/net-lib.sh: line 110: [: missing `]'

---
 modules.d/40network/net-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
modules.d/40network/net-lib.sh +1 -1
index 48e7014..d9c5a1d 100755
@@ -105,7 +105,7 @@ setup_net() {
     # add static route
     for _p in $(getargs rd.route); do
         route_to_var "$_p" || continue
-        [ -n "$route_dev" ] && [ "$route_dev" != "$netif"] && continue
+        [ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
         ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
         if strstr ":" "$route_mask"; then
             printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
Signature · 1 line
1.8.3.1
#2 lore raw
In reply to a message not in the archive
Quoted 16 lines · Minfei Huang

In the judgment sentence, it will print the following warning message, becasuse of lacking the blank on the left of ']'.

/lib/net-lib.sh: line 110: [: missing `]'

---
 modules.d/40network/net-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
modules.d/40network/net-lib.sh +0 -0
index 48e7014..d9c5a1d 100755

modules.d/40network/net-lib.sh setup_net() { · line 111

Quoted 8 lines
modules.d/40network/net-lib.sh +1 -1
@@ -105,7 +105,7 @@ setup_net() {
     # add static route
     for _p in $(getargs rd.route); do
         route_to_var "$_p" || continue
-        [ -n "$route_dev" ] && [ "$route_dev" != "$netif"] && continue
+        [ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
         ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
         if strstr ":" "$route_mask"; then
             printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \

pushed... Thanks!