diff options
author | Xavion <xavion.0@gmail.com> | 2011-07-03 11:38:03 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-07-03 11:38:03 +0200 |
commit | 21d890c14fae01edcc088821418338de84220adb (patch) | |
tree | 573bf50c3a26f39efb68f6129696bd52340e8832 | |
parent | fee8e27f322f53db66a28ecd96cc90c802210ba2 (diff) | |
download | netctl-21d890c14fae01edcc088821418338de84220adb.tar.gz netctl-21d890c14fae01edcc088821418338de84220adb.tar.xz |
ethernet: correctly stop dhclient when bringing down interfaces (FS#23293)
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
-rw-r--r-- | src/connections/ethernet | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet index 8ebb7dd..03439e8 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -213,9 +213,19 @@ ethernet_down() { load_profile "$1" if [[ "$IP" == "dhcp" ]]; then - if [[ -f "/var/run/dhcpcd-${INTERFACE}.pid" ]]; then - report_debug ethernet_down dhcpcd -qx "$INTERFACE" - dhcpcd -qk "$INTERFACE" &>/dev/null + if checkyesno "${DHCLIENT:-no}"; then + if [[ -f "/run/dhclient-$INTERFACE.pid" ]]; then + report_debug ethernet_down dhclient -q -r "$INTERFACE" + dhclient -q -x "$INTERFACE" &>/dev/null + #dhclient -q -r "$INTERFACE" &>/dev/null + report_debug ethernet_down /bin/kill $(cat /run/dhclient-$INTERFACE.pid) + /bin/kill $(cat /run/dhclient-$INTERFACE.pid) &>/dev/null + fi + else + if [[ -f "/var/run/dhcpcd-$INTERFACE.pid" ]]; then + report_debug ethernet_down dhcpcd -qk "$INTERFACE" + dhcpcd -qk "$INTERFACE" &>/dev/null + fi fi fi |