diff options
author | Tom Gundersen <teg@jklm.no> | 2012-07-23 17:20:03 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2012-07-23 21:18:33 +0200 |
commit | 1aa9be8cf533cb5b56f2f79ad26ed4fcffe6f824 (patch) | |
tree | e30f7d330b967e18ef56b4b5a550323da57b29d8 | |
parent | c82d8bc881397bdde91081d2788e95a78e209d57 (diff) |
network: fix network_down when no interface is set
Signed-off-by: Tom Gundersen <teg@jklm.no>
-rwxr-xr-x | network | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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() { |