summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2019-11-07 04:27:35 +0000
committerDarren 'Tadgy' Austin <darren@afterdark.org.uk>2019-11-07 04:27:35 +0000
commitfaee3d63c19cf5c83e3bfbd4839e6c6de892c5a4 (patch)
treec9d07e931cbfd67a6394661da724b93d6a6ca179
parentd66ca96733f0292d4a6d1aad8bc24ecc6c4906de (diff)
downloadslacknetsetup-faee3d63c19cf5c83e3bfbd4839e6c6de892c5a4.tar.xz
Walk _backwards_ through interfaces when deconfiguring.
-rw-r--r--rc.inet15
1 files changed, 3 insertions, 2 deletions
diff --git a/rc.inet1 b/rc.inet1
index baeeddb..2b95bac 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -416,6 +416,7 @@ if_down() {
fi
# Take down VLAN interface, if configured.
if echo "${1}" | grep -Fq .; then
+ echo "/etc/rc.d/rc.inet1: /sbin/ip link delete ${1}" | $LOGGER
/sbin/ip link delete ${1}
fi
# Kill wireless daemons if any:
@@ -476,8 +477,8 @@ start() {
# Function to stop the network:
stop() {
gateway_down
- for i in "${IFNAME[@]}" ; do
- if_down $i
+ for (( i = $MAXNICS; i >= 0; i-- )); do
+ if_down ${IFNAME[$i]}
done
virtif_destroy
lo_down