diff options
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -367,8 +367,10 @@ if_down() { echo "/etc/rc.d/rc.inet1: failed to stop dhcpcd for interface ${1}" | $LOGGER fi # Disable v6 IP auto configuration and RA before trying to clear the IP from the interface: - echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf - echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra + if [ -e /proc/sys/net/ipv6 ]; then + echo "0" >/proc/sys/net/ipv6/conf/$1/autoconf + echo "0" >/proc/sys/net/ipv6/conf/$1/accept_ra + fi sleep 0.5 # allow time for dhcp/ra to unconfigure the interface # Flush any remaining IPs: echo "/etc/rc.d/rc.inet1: /sbin/ip address flush dev ${1}" | $LOGGER @@ -377,8 +379,10 @@ if_down() { echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev ${1} down" | $LOGGER /sbin/ip link set dev ${1} down # Reset autoconf and accept_ra back to defaults: - cat /proc/sys/net/ipv6/conf/default/autoconf >/proc/sys/net/ipv6/conf/$1/autoconf - cat /proc/sys/net/ipv6/conf/default/accept_ra >/proc/sys/net/ipv6/conf/$1/accept_ra + if [ -e /proc/sys/net/ipv6 ]; then + cat /proc/sys/net/ipv6/conf/default/autoconf >/proc/sys/net/ipv6/conf/$1/autoconf + cat /proc/sys/net/ipv6/conf/default/accept_ra >/proc/sys/net/ipv6/conf/$1/accept_ra + fi # Kill wireless daemons if any: if [ -x /etc/rc.d/rc.wireless ]; then . /etc/rc.d/rc.wireless ${1} stop |