From e0800c21db6316f0a41461f2e02fc7565d7c1a49 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Fri, 18 Jan 2013 10:58:33 +0100 Subject: [PATCH] Forward Firewall: Edited Backup.pl so that any old backups get converted to new firewall. Afterwards the directories /var/ipfire/outgoing and /var/ipfire/xtaccess are removed! --- config/backup/backup.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index f9b8302af..0d7585321 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -22,7 +22,7 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; - +use File::Path; my $debug = 1; my @include = ""; my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, $Jahr, $Wochentag, $Jahrestag, $Sommerzeit) = localtime(time); @@ -64,7 +64,17 @@ elsif ($ARGV[0] eq 'restore') { system("cd / && tar -xvz -p -f /tmp/restore.ipf"); #Here some converter scripts to correct old Backups (before core 65) system("/usr/sbin/ovpn-ccd-convert"); -} + system("/usr/sbin/convert-xtaccess"); + system("/usr/sbin/convert-outgoingfw"); + + #clean up system, if an old backup was restored + if( -d "/var/ipfire/outgoing"){ + rmtree("/var/ipfire/outgoing"); + } + if( -d "/var/ipfire/xtaccess"){ + rmtree("/var/ipfire/xtaccess"); + } + } elsif ($ARGV[0] eq 'restoreaddon') { if ( -e "/tmp/$ARGV[1]" ){system("mv /tmp/$ARGV[1] /var/ipfire/backup/addons/backup/$ARGV[1]");} system("cd / && tar -xvz -p -f /var/ipfire/backup/addons/backup/$ARGV[1]"); -- 2.39.2