- local ifname
- config_get ifname "$cfg" ifname
-
- [ -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-${ifname}.pid"
- }