]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Forward Firewall: Edited Backup.pl so that any old backups get converted to new firew...
authorAlexander Marx <amarx@ipfire.org>
Fri, 18 Jan 2013 09:58:33 +0000 (10:58 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:08:12 +0000 (14:08 +0200)
config/backup/backup.pl

index f9b8302af91af7c90c8fa9a8d9a5b63773542613..0d75853211035cfb3758f2ffbf6787c59f5c4bf1 100644 (file)
@@ -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]");