From: Mike Frysinger Date: Tue, 9 Jan 2018 23:19:59 +0000 (-0500) Subject: ifcfg/rtpr: convert to POSIX shell X-Git-Tag: v4.15.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8b970d7d241de8ea2885d6d0b72fec0f557422d;p=thirdparty%2Fiproute2.git ifcfg/rtpr: convert to POSIX shell These files are already mostly written in POSIX shell, so convert their shebangs to /bin/sh and tweak the few bashisms in here. URL: https://crbug.com/756559 Reported-by: Pat Erley Signed-off-by: Mike Frysinger --- diff --git a/ip/ifcfg b/ip/ifcfg index 851b9215a..5b34decd4 100755 --- a/ip/ifcfg +++ b/ip/ifcfg @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # SPDX-License-Identifier: GPL-2.0 CheckForwarding () { @@ -7,7 +7,7 @@ CheckForwarding () { fwd=0 if [ -d $sbase ]; then for dir in $sbase/*/forwarding; do - fwd=$[$fwd + `cat $dir`] + fwd=$(( fwd + $(cat "$dir") )) done else fwd=2 @@ -128,12 +128,12 @@ fi arping -q -A -c 1 -I $dev $ipaddr noarp=$? ( sleep 2 ; - arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null /dev/null 2>&1 & /dev/null -ip route add unreachable 255.255.255.255 >& /dev/null +ip route add unreachable 224.0.0.0/24 >/dev/null 2>&1 +ip route add unreachable 255.255.255.255 >/dev/null 2>&1 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 + ip route add 224.0.0.0/4 dev $dev scope global >/dev/null 2>&1 fi if [ $fwd -eq 0 ]; then diff --git a/ip/rtpr b/ip/rtpr index 192a476f8..7e48674bc 100755 --- a/ip/rtpr +++ b/ip/rtpr @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # SPDX-License-Identifier: GPL-2.0 exec tr "[\\\\]" "[