mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
ipsec: only write /var/db/ipsecpinghosts if not empty; closes #6600
This commit is contained in:
parent
97343e3aae
commit
45726533f5
@ -827,12 +827,11 @@ function ipsec_configure_spd()
|
||||
function ipsec_setup_pinghosts()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$a_phase1 = isset($config['ipsec']['phase1']) ? $config['ipsec']['phase1'] : [];
|
||||
$a_phase2 = isset($config['ipsec']['phase2']) ? $config['ipsec']['phase2'] : [];
|
||||
|
||||
/* get the automatic ping_hosts.sh ready */
|
||||
@unlink('/var/db/ipsecpinghosts');
|
||||
@touch('/var/db/ipsecpinghosts');
|
||||
|
||||
if (!isset($config['ipsec']['enable'])) {
|
||||
return;
|
||||
@ -904,7 +903,11 @@ function ipsec_setup_pinghosts()
|
||||
}
|
||||
}
|
||||
}
|
||||
@file_put_contents('/var/db/ipsecpinghosts', $ipsecpinghosts);
|
||||
|
||||
if (!empty($ipsecpinghosts)) {
|
||||
/* get the automatic ping_hosts.sh ready */
|
||||
@file_put_contents('/var/db/ipsecpinghosts', $ipsecpinghosts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user