diff options
Diffstat (limited to 'usr/local/www/interfaces_ppp.php')
-rw-r--r-- | usr/local/www/interfaces_ppp.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/local/www/interfaces_ppp.php b/usr/local/www/interfaces_ppp.php index 1ba34ab..4c0e52b 100644 --- a/usr/local/www/interfaces_ppp.php +++ b/usr/local/www/interfaces_ppp.php @@ -63,7 +63,18 @@ if ($_GET['act'] == "del") { if (ppp_inuse($_GET['id'])) { $input_errors[] = "This PPP interface cannot be deleted because it is still being used as an interface."; } else { - mwexec("/sbin/ifconfig " . $a_ppps[$_GET['id']]['pppif'] . " destroy"); + $realif = $a_ppps[$_GET['id']]['pppif']; + if ($realif <> "") { + $i = 0; + while ($realif != "ppp{$i}") + $i++; + if (file_exists("/var/run/ppp{$i}.pid")) { + $pid = trim(file_get_contents("/var/run/ppp{$i}.pid")); + mwexec("kill {$pid}"); + } + } + + mwexec("/sbin/ifconfig {$realif} destroy"); unset($a_ppps[$_GET['id']]); write_config(); |