mirror of
https://github.com/hwdsl2/setup-ipsec-vpn.git
synced 2026-05-17 08:05:45 +03:00
Update IKEv2 setup log
- When using the IKEv2 change server address script on Docker, update the IKEv2 setup log with the new server address, so that it can be displayed in the container logs after a restart.
This commit is contained in:
@@ -248,6 +248,13 @@ update_ikev2_conf() {
|
||||
sed -i "/conn ikev2-cp/a \ leftcert=$server_addr" /etc/ipsec.d/ikev2.conf
|
||||
}
|
||||
|
||||
update_ikev2_log() {
|
||||
ikev2_log="/etc/ipsec.d/ikev2setup.log"
|
||||
if [ -s "$ikev2_log" ]; then
|
||||
sed -i "/VPN server address:/s/$server_addr_old/$server_addr/" "$ikev2_log"
|
||||
fi
|
||||
}
|
||||
|
||||
restart_ipsec_service() {
|
||||
bigecho "Restarting IPsec service..."
|
||||
mkdir -p /run/pluto
|
||||
@@ -278,6 +285,7 @@ ikev2changeaddr() {
|
||||
|
||||
create_server_cert
|
||||
update_ikev2_conf
|
||||
update_ikev2_log
|
||||
if [ "$os_type" = "alpine" ]; then
|
||||
ipsec auto --replace ikev2-cp >/dev/null
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user