]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
backup.pl: Update the RW entry in collectd.vpn if restoring old backup
authorAdolf Belka <adolf.belka@ipfire.org>
Mon, 8 Sep 2025 12:59:38 +0000 (14:59 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 14 Sep 2025 10:39:39 +0000 (10:39 +0000)
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/backup/backup.pl

index e79f510c67bb43e2f580d600cf5c4bf91d118063..8988427eae22dbc519580f9b9f62a5fe401f065f 100644 (file)
@@ -349,8 +349,12 @@ restore_backup() {
                rm /var/log/pakfire.log
        fi
 
-       # Update the OpenVPN configuration and restart the openvpn daemons
+       # Update the OpenVPN configuration, update the RW log entry in collectd.vpn
+       # if it is the old name and restart the openvpn daemons
        sudo -u nobody /srv/web/ipfire/cgi-bin/ovpnmain.cgi
+       if grep -q "/var/run/ovpnserver.log" /var/ipfire/ovpn/collectd.vpn; then
+               sed -i 's|"/var/run/ovpnserver.log"|"/var/run/openvpn-rw.log"|' /var/ipfire/ovpn/collectd.vpn
+       fi
        /etc/init.d/openvpn-n2n restart
        /etc/init.d/openvpn-rw restart