mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
ipsec: mute ipsec.conf related load errors
PR: https://forum.opnsense.org/index.php?topic=33126.0
This commit is contained in:
parent
11209256e2
commit
b7f34d02eb
@ -1305,10 +1305,16 @@ function ipsec_configure_do($verbose = false, $interface = '')
|
||||
|
||||
service_log('Configuring IPsec VPN...', $verbose);
|
||||
|
||||
/* cleanup legacy ipsec.conf files */
|
||||
/* cleanup legacy ipsec.conf bits but then recreate structure to mute charon complaints */
|
||||
mwexec('rm -rf /usr/local/etc/ipsec.d');
|
||||
@unlink('/usr/local/etc/ipsec.conf');
|
||||
@unlink('/usr/local/etc/ipsec.secrets');
|
||||
foreach (['aacerts', 'acerts', 'cacerts', 'certs', 'crls', 'ocspcerts', 'private', 'reqs'] as $dir) {
|
||||
mkdir("/usr/local/etc/ipsec.d/{$dir}", 0664, true);
|
||||
}
|
||||
foreach (['/usr/local/etc/ipsec.conf', '/usr/local/etc/ipsec.secrets'] as $file) {
|
||||
/* unlink AND copy in case the sample files are not available */
|
||||
@unlink($file);
|
||||
@copy("{$file}.sample", $file);
|
||||
}
|
||||
|
||||
ipsec_write_strongswan_conf();
|
||||
ipsec_write_cas();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user