From 21d890c14fae01edcc088821418338de84220adb Mon Sep 17 00:00:00 2001 From: Xavion Date: Sun, 3 Jul 2011 11:38:03 +0200 Subject: ethernet: correctly stop dhclient when bringing down interfaces (FS#23293) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Oudompheng --- src/connections/ethernet | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/connections/ethernet') 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 -- cgit v1.2.3-24-g4f1b