summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-09 23:08:08 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-09 23:08:08 +0000
commitdb3996df1538315fab6f625e5f1dea8493696f7b (patch)
tree13d6ea13d49cb374db2efffe6277b725f81b456c /usr/local
parent9d10caaaa5dce5fae0dda83188aebf6838b79533 (diff)
downloadpfsense-db3996df1538315fab6f625e5f1dea8493696f7b.zip
pfsense-db3996df1538315fab6f625e5f1dea8493696f7b.tar.gz
Unset the traffic shaper when importing from m0n0wall
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/diag_backup.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 592f0e2..f701116 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -128,6 +128,7 @@ if ($_POST) {
$fd = fopen($_FILES['conffile']['tmp_name'], "w");
fwrite($fd, $upgradedconfig);
fclose($fd);
+ $m0n0wall_upgrade = true;
}
if($_POST['restorearea'] <> "") {
/* restore a specific area of the configuration */
@@ -144,7 +145,7 @@ if ($_POST) {
if(stristr($rules, "pfsense") == false) {
$input_errors[] = "You have selected to restore the full configuration but we could not locate a pfsense tag.";
} else {
- /* restore the entire configuration */
+ /* restore the entire configuration */
if (config_install($_FILES['conffile']['tmp_name']) == 0) {
/* this will be picked up by /index.php */
conf_mount_rw();
@@ -152,11 +153,24 @@ if ($_POST) {
conf_mount_ro();
$reloadall = true;
$savemsg = "The configuration has been restored. The firewall is now rebooting.";
+ /* remove cache, we will force a config reload */
+ if(file_exists("/tmp/config.cache"))
+ unlink("/tmp/config.cache");
+ parse_config(true);
+ /* force a configuration upgrade */
+ convert_config();
+ if($m0n0wall_upgrade == true) {
+ if($config['system']['gateway'] <> "") {
+ $config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
+ }
+ unset($config['shaper']);
+ }
+ write_config();
} else {
$input_errors[] = "The configuration could not be restored.";
}
}
- }
+ }
} else {
$input_errors[] = "The configuration could not be restored (file upload error).";
}
OpenPOWER on IntegriCloud