From 7793e4bc195201c6c01582e79a2f323adcd35170 Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Sun, 26 Nov 2017 18:21:10 -0600 Subject: [PATCH] The following changes were made * Removed non POSIX redirects * Removed setting of loopback up (seems to do this on its own?) * Corrected $verbose variable check (was -z, should be -n) * Added quotes for ip route command around $iface (colon was a problem) * Should note that v1.2 was incorrectly set in Makefile previously --- SRC/iftools/ifup | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/SRC/iftools/ifup b/SRC/iftools/ifup index 59db17e..1c94095 100755 --- a/SRC/iftools/ifup +++ b/SRC/iftools/ifup @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=1.1 +VERSION=1.2 CONFDIR=/etc CONFIGFILE=$CONFDIR/network.conf NL=' @@ -19,7 +19,9 @@ auto () { fi ;; esac - done <<< "$1" + done << EOF +$1 +EOF echo "$autoifaces" } @@ -84,7 +86,9 @@ getinet () { address=${address%% *} ;; esac - done <<< "$(ip addr show $iface)" + done << EOF +$(ip addr show $iface) +EOF echo $address } @@ -218,7 +222,9 @@ up () { ;; esac fi - done <<< "$2" + done << EOF +$2 +EOF if [ -z "$exists" ]; then echo "$iface not defined" @@ -306,10 +312,8 @@ up () { if [ -n "$noact" ]; then echo "ip link set dev $iface up" - echo "ip addr add 127.0.0.1/8 dev $iface" else ip link set dev $iface up - ip addr add 127.0.0.1/8 dev $iface fi elif [ -n "$static" ]; then case "$iface" in @@ -353,7 +357,7 @@ up () { fi if [ -n "$gateway" ]; then - [ -z "$verbose" ] && echo "Setting default route via $gateway" + [ -n "$verbose" ] && echo "Setting default route via $gateway" if [ -n "$noact" ]; then echo "ip route add default via $gateway" @@ -381,7 +385,7 @@ up () { if [ -n "$noact" ]; then echo "ip route add $route dev $iface src $address" else - ip route add $route dev $iface src $address + ip route add $route dev "$iface" src "$address" fi done fi