mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-25 08:51:09 +02:00
[package] base-files, ppp: fix interface shutdown
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21386 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
d9494637a8
commit
19b6acd090
@ -333,12 +333,12 @@ stop_interface_dhcp() {
|
|||||||
local config="$1"
|
local config="$1"
|
||||||
|
|
||||||
local iface
|
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"
|
[ -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)"
|
local pid="$(cat "$pidfile" 2>/dev/null)"
|
||||||
[ -d "/proc/$pid" ] && {
|
[ -d "/proc/$pid" ] && {
|
||||||
grep -qs udhcpc "/proc/$pid/cmdline" && kill -TERM $pid && \
|
grep -qs udhcpc "/proc/$pid/cmdline" && kill -TERM $pid && \
|
||||||
|
@ -7,15 +7,14 @@ stop_interface_ppp() {
|
|||||||
local ifname
|
local ifname
|
||||||
config_get ifname "$cfg" ifname
|
config_get ifname "$cfg" ifname
|
||||||
|
|
||||||
local link="${proto:-ppp}-$ifname"
|
[ -f "/var/run/ppp-${ifname}.pid" ] && {
|
||||||
[ -f "/var/run/ppp-${link}.pid" ] && {
|
local pid="$(head -n1 /var/run/ppp-${ifname}.pid 2>/dev/null)"
|
||||||
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
|
|
||||||
grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
|
grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
|
||||||
while grep -qs pppd "/proc/$pid/cmdline"; do sleep 1; done
|
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"
|
[ -f "$lock" ] && lock -u "$lock"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user