interfaces: loosely related cleanups #2707

This commit is contained in:
Franco Fichtner 2018-12-30 14:03:45 +01:00
parent 446c68157f
commit 3bb0e00e19
2 changed files with 5 additions and 10 deletions

View File

@ -1171,9 +1171,6 @@ function interface_ppps_configure($interface)
return 0;
}
// mpd5 requires a /var/spool/lock directory for PPP modem links.
@mkdir("/var/spool/lock", 0777, true);
// mpd5 modem chat script expected in the same directory as the mpd_xxx.conf files
if (!file_exists('/var/etc/mpd.script')) {
symlink('/usr/local/sbin/mpd.script', '/var/etc/mpd.script');

View File

@ -231,11 +231,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$ppp['mru'] = implode(',', $port_data['mru']);
$ppp['mrru'] = implode(',', $port_data['mrru']);
// XXX this was already in here, but is probably not the correct place to create this
if (!is_dir('/var/spool/lock')) {
mwexec('/bin/mkdir -p /var/spool/lock');
}
if (isset($id)) {
$a_ppps[$id] = $ppp;
} else {
@ -243,11 +238,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
write_config();
$iflist = get_configured_interface_with_descr();
foreach ($iflist as $pppif => $ifdescr) {
if ($config['interfaces'][$pppif]['if'] == $ppp['if'])
interface_ppps_configure($pppif);
if ($config['interfaces'][$pppif]['if'] == $ppp['if']) {
interface_ppps_configure($pppif);
}
}
header(url_safe('Location: /interfaces_ppps.php'));
exit;
}