Forward Firewall: edited Backup.pl. If someone put /var/ipfire/outgoing into /var/ipfire/backup/include, the rules are backed up and need to be restored.

Now the backup takes care of this and checks if there are old rules to convert.
This commit is contained in:
Alexander Marx
2013-01-20 05:54:04 +01:00
committed by Michael Tremer
parent 8794629653
commit 9edb1d7a8e
3 changed files with 15 additions and 4 deletions

View File

@@ -64,13 +64,24 @@ 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");
if( -d "/var/ipfire/outgoing"){
if( -d "${General::swroot}/outgoing"){
if( -f "${General::swroot}/forward/config" ){
unlink("${General::swroot}/forward/config");
system("touch ${General::swroot}/forward/config");
chown 99,99,"${General::swroot}/forward/config";
}
if( -f "${General::swroot}/forward/input" ){
unlink("${General::swroot}/forward/input");
system("touch ${General::swroot}/forward/input");
chown 99,99,"${General::swroot}/forward/input";
}
system("/usr/sbin/convert-outgoingfw");
rmtree("/var/ipfire/outgoing");
rmtree("${General::swroot}/outgoing");
system("/usr/local/bin/forwrdfwctrl");
}
if( -d "/var/ipfire/xtaccess"){
if( -d "${General::swroot}/xtaccess"){
system("/usr/sbin/convert-xtaccess");
rmtree("/var/ipfire/xtaccess");
rmtree("${General::swroot}/xtaccess");
}
}
elsif ($ARGV[0] eq 'restoreaddon') {

0
config/forwardfw/convert-outgoingfw Normal file → Executable file
View File

0
config/forwardfw/convert-xtaccess Normal file → Executable file
View File