mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 09:34:39 +00:00
remove some more package code / garbage code
This commit is contained in:
parent
edb37740af
commit
a0c784a686
@ -867,7 +867,7 @@ function vpn_ipsec_force_reload($interface = "") {
|
||||
|
||||
$ipseccfg = $config['ipsec'];
|
||||
|
||||
if (!empty($interface) && is_array($ipseccfg['phase1'])) {
|
||||
if (!empty($interface) && isset($ipseccfg['phase1']) && is_array($ipseccfg['phase1'])) {
|
||||
$found = false;
|
||||
foreach ($ipseccfg['phase1'] as $ipsec) {
|
||||
if (!isset($ipsec['disabled']) && ($ipsec['interface'] == $interface)) {
|
||||
|
||||
@ -45,16 +45,6 @@ if (file_exists('/var/run/booting')) {
|
||||
return;
|
||||
}
|
||||
|
||||
function restart_packages() {
|
||||
global $oldip, $curwanip, $g;
|
||||
|
||||
/* restart packages */
|
||||
system_ntp_configure(false);
|
||||
mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", false, true);
|
||||
log_error("{$g['product_name']} package system has detected an ip change $oldip -> $curwanip ... Restarting packages.");
|
||||
configd_run("service reload packages");
|
||||
}
|
||||
|
||||
/* Interface IP address has changed */
|
||||
$argument = str_replace("\n", "", $argv[1]);
|
||||
|
||||
@ -74,6 +64,9 @@ $interface_descr = convert_friendly_interface_to_friendly_descr($interface);
|
||||
if (is_array($config['interfaces'][$interface]) && !isset($config['interfaces'][$interface]['enable'])) {
|
||||
log_error("Interface is disabled, nothing to do.");
|
||||
return;
|
||||
} elseif (empty($interface)) {
|
||||
log_error("Interface is empty, nothing to do.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($argument))
|
||||
@ -100,12 +93,6 @@ if ($curwanip == "0.0.0.0" || !is_ipaddr($curwanip)) {
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX: This really possible? */
|
||||
if (empty($interface)) {
|
||||
filter_configure();
|
||||
restart_packages();
|
||||
return;
|
||||
}
|
||||
|
||||
$oldip = "0.0.0.0";
|
||||
if (file_exists("{$g['vardb_path']}/{$interface}_cacheip"))
|
||||
@ -210,8 +197,10 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface
|
||||
|
||||
/* restart snmp */
|
||||
services_snmpd_configure();
|
||||
|
||||
restart_packages();
|
||||
|
||||
/* reconfigure ntpd */
|
||||
system_ntp_configure(false);
|
||||
mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", false, true);
|
||||
}
|
||||
|
||||
/* signal filter reload */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user