X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=scripts%2Fifup;h=149cb17a69f20ec1b9cfb9d5f0c76474dd2b0f6e;hb=8ab370eace6aeb1e067fb4175187fd4d7b1235c1;hp=98b5c59be30969454bf591edadc681e6f27420b6;hpb=9ea1bff7b049ce152767460c68bb61f6aa500cef;p=startuptools diff --git a/scripts/ifup b/scripts/ifup index 98b5c59..149cb17 100755 --- a/scripts/ifup +++ b/scripts/ifup @@ -2,10 +2,10 @@ net=$1 +saveifs="$IFS" IFS=';' -# TODO allow for /etc/sysconfig/$net also -test -f /etc/sysconfig/$net.net || echo "unknown network configuration '$net'" >&2 && exit 1 +test -f /etc/networks/$net || (echo "unknown network configuration '$net'" >&2 && exit 1) ifup_post() { return 0 @@ -15,20 +15,29 @@ ifup_pre() { return 0 } -. /etc/sysconfig/$net.net +. /etc/networks/$net -if [ $enable = 'no' || $enable -eq 0 ]; then; exit 0; fi +if [ "$enable" = 'no' ]; then exit 0; fi +#if [ "$enable" -eq 0 ]; then exit 0; fi ifup_pre ip link set dev $dev up -for address in $addr do - ip addr add $address dev $dev -done +if [ "$addr" = 'dhcp' ]; then + /sbin/dhcpcd -q $dev +else + for address in $addr; do + IFS="$saveifs" + ip addr add $address dev $dev + IFS=';' + done +fi for r in $route; do + IFS="$saveifs" ip route add $r + IFS=';' done ifup_post