base-files, ppp: fix interface shutdown
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 6 May 2010 01:14:24 +0000 (01:14 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 6 May 2010 01:14:24 +0000 (01:14 +0000)
SVN-Revision: 21386

package/base-files/files/lib/network/config.sh
package/ppp/files/ppp.sh

index 80547b76d5f44f4f2a5d105a3b58369e5802a599..4336244f6e8cb5530a9020deb0922e6277bfeb96 100755 (executable)
@@ -333,12 +333,12 @@ stop_interface_dhcp() {
        local config="$1"
 
        local iface
-       config_get iface "$config" iface
+       config_get ifname "$config" ifname
 
-       local lock="/var/lock/dhcp-${iface}"
+       local lock="/var/lock/dhcp-${ifname}"
        [ -f "$lock" ] && lock -u "$lock"
 
-       local pidfile="/var/run/dhcp-${iface}.pid"
+       local pidfile="/var/run/dhcp-${ifname}.pid"
        local pid="$(cat "$pidfile" 2>/dev/null)"
        [ -d "/proc/$pid" ] && {
                grep -qs udhcpc "/proc/$pid/cmdline" && kill -TERM $pid && \
index b3c9e5365553de610ae22993d1d7d1715bfaffe3..f4417bb67ec1b78b5be8f1f71fae4ad617c2a264 100644 (file)
@@ -7,15 +7,14 @@ stop_interface_ppp() {
        local ifname
        config_get ifname "$cfg" ifname
 
-       local link="${proto:-ppp}-$ifname"
-       [ -f "/var/run/ppp-${link}.pid" ] && {
-               local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
+       [ -f "/var/run/ppp-${ifname}.pid" ] && {
+               local pid="$(head -n1 /var/run/ppp-${ifname}.pid 2>/dev/null)"
                grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
                        while grep -qs pppd "/proc/$pid/cmdline"; do sleep 1; done
-               rm -f "/var/run/ppp-${link}.pid"
+               rm -f "/var/run/ppp-${ifname}.pid"
        }
 
-       local lock="/var/lock/ppp-$link"
+       local lock="/var/lock/ppp-$ifname"
        [ -f "$lock" ] && lock -u "$lock"
 }