diff options
Diffstat (limited to 'main/openrc/networking.initd')
-rw-r--r-- | main/openrc/networking.initd | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/main/openrc/networking.initd b/main/openrc/networking.initd index 2f7bec65ec..00613e0a48 100644 --- a/main/openrc/networking.initd +++ b/main/openrc/networking.initd @@ -3,9 +3,15 @@ # note that the spoofprotect, syncoockies and ip_forward options are set in # /etc/sysctl.conf -ifconf=/etc/network/interfaces ifstate=/var/run/ifstate +if [ -f "$cfgfile" ]; then + ifopts="-i $cfgfile" +else + ifopts= + cfgfile="/etc/network/interfaces" +fi + single_iface="${SVCNAME#*.}" if [ "$single_iface" = "$SVCNAME" ]; then single_iface= @@ -23,7 +29,7 @@ find_ifaces() { if [ -n "$single_iface" ]; then echo $single_iface else - awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' $ifconf + awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' "$cfgfile" fi } @@ -43,8 +49,8 @@ start() { for iface in $(find_ifaces); do local r=0 ebegin "$iface" - if ! ifup $iface >/dev/null; then - ifdown $iface >/dev/null 2>&1 + if ! ifup $ifopts $iface >/dev/null; then + ifdown $ifopts $iface >/dev/null 2>&1 r=1 fi # atleast one interface needs to be started for action @@ -64,7 +70,7 @@ stop() { eindent for iface in $(find_running_ifaces); do ebegin "$iface" - ifdown -f $iface >/dev/null + ifdown $ifopts -f $iface >/dev/null eend $? done eoutdent |