summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnetwork15
1 files changed, 10 insertions, 5 deletions
diff --git a/network b/network
index 9f8b0a3..b28c523 100755
--- a/network
+++ b/network
@@ -34,13 +34,18 @@ network_up() {
}
network_down() {
- if [[ ! -n $address ]] && [[ -f /run/dhcpcd-$interface.pid || -f /run/dhcpcd.pid ]]; then
- dhcpcd -qk $interface || return 1
+ if [[ ! -n $interface ]]; then
+ if [[ -f /run/dhcpcd.pid ]]; then
+ dhcpcd -qk || return 1
+ fi
else
- ip addr flush dev $interface || return 1
+ if [[ ! -n $address && -f /run/dhcpcd-$interface.pid ]]; then
+ dhcpcd -qk $interface || return 1
+ else
+ ip addr flush dev $interface || return 1
+ fi
+ ip link set dev $interface down || return 1
fi
-
- ip link set dev $interface down || return 1
}
ifup() {