]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/backup/backup.pl
mympd: remove create config start
[ipfire-2.x.git] / config / backup / backup.pl
index 7992f21c58aba352c1c3548c2103b8d2f9ad2d66..d848084e944e68225a7d52f51ddc5635b862cde5 100644 (file)
@@ -75,6 +75,10 @@ make_backup() {
 restore_backup() {
        local filename="${1}"
 
+       # remove all openvpn certs to prevent old unusable
+       # certificates being left in directory after a restore
+       rm -f /var/ipfire/ovpn/certs/*
+
        # Extract backup
        if ! tar xvzpf "${filename}" -C / \
                        --exclude-from="/var/ipfire/backup/exclude" \
@@ -189,7 +193,7 @@ restore_backup() {
 
        # Update OpenVPN CRL
        /etc/fcron.daily/openvpn-crl-updater
-       
+
        # Update OpenVPN N2N Client Configs
        ## Add providers legacy default line to n2n client config files
        # Check if ovpnconfig exists and is not empty
@@ -242,6 +246,17 @@ restore_backup() {
                        -signkey /etc/httpd/server.key \
                        -out /etc/httpd/server.crt &>/dev/null
        fi
+
+       # Remove any entry for ALIENVAULT or SPAMHAUS_EDROP from the ipblocklist modified file
+       # and the associated ipblocklist files from the /var/lib/ipblocklist directory
+       sed -i '/ALIENVAULT=/d' /var/ipfire/ipblocklist/modified
+       sed -i '/SPAMHAUS_EDROP=/d' /var/ipfire/ipblocklist/modified
+       if [ -e /var/lib/ipblocklist/ALIENVAULT.conf ]; then
+               rm /var/lib/ipblocklist/ALIENVAULT.conf
+       fi
+       if [ -e /var/lib/ipblocklist/SPAMHAUS_EDROP.conf ]; then
+               rm /var/lib/ipblocklist/SPAMHAUS_EDROP.conf
+       fi
        return 0
 }