]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
backup.pl: Fixes bug13737 - restarts ipsec to use the restored certs etc
authorAdolf Belka <adolf.belka@ipfire.org>
Tue, 1 Apr 2025 20:50:02 +0000 (22:50 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Apr 2025 09:59:16 +0000 (09:59 +0000)
- This adds a check if the ipsec server is enabled. If it is then ipsecctrl is run to
   restart ipsec and ensure that the restored certs are all being used.
- Tested this out on my vm testbed and confirmed that with this I could restore a backup
   and make the client connection as previously set up.
- Without this I had to press the Save button on the ipsec WUI page to get the certs
   etc being used.

Fixes: bug13737
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/backup/backup.pl

index 1c8c87d0a9242a3946c609dd2e276d8456cbe4b4..0cfbd4fc3838c6b1cd499565d8252779780581b9 100644 (file)
@@ -307,6 +307,12 @@ restore_backup() {
        # start collectd after restore
        /etc/rc.d/init.d/collectd start
 
+        # Restart ipsec if enabled
+        # This will ensure that the restored certs and secrets etc are loaded and used
+        if [ $(grep -c "ENABLED=on" /var/ipfire/vpn/settings) -eq 1  ] ; then
+                /usr/local/bin/ipsecctrl S
+        fi
+
        return 0
 }