summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-05-24 10:05:07 +0100
committerstilez <stilez@users.noreply.github.com>2016-05-24 10:05:07 +0100
commit09a283948eada745bc10b852e63b7dec50fb69d4 (patch)
tree52a3cc722727a06779c8b4e8a4e67fa8416907a1 /src/etc
parentca55edc39342865816feef390616be8b770c889b (diff)
downloadpfsense-09a283948eada745bc10b852e63b7dec50fb69d4.zip
pfsense-09a283948eada745bc10b852e63b7dec50fb69d4.tar.gz
set default_config_backup_count based on platform
At the same time the platform is being detected for PHP/GUI purposes, set the default number of backups. Also handle the case where (for any reason) detection fails, which it shouldn't, so the variables are still created
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/globals.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc
index 221df9e..abbaf20 100644
--- a/src/etc/inc/globals.inc
+++ b/src/etc/inc/globals.inc
@@ -151,11 +151,17 @@ if (file_exists("/etc/platform")) {
if ($g['platform'] == "nanobsd") {
$g['firmware_update_text']="pfSense-*.img.gz";
$g['hidebackupbeforeupgrade'] = true;
-
+ $g['default_config_backup_count'] = 5;
} else {
$g['firmware_update_text']="pfSense-*.tgz";
+ $g['default_config_backup_count'] = 30;
}
-}
+} else {
+ // shouldn't happen but "just in case" no platform were detected
+ $g['platform'] = 'undetected';
+ $g['default_config_backup_count'] = 30;
+}
+
if (file_exists("{$g['etc_path']}/default-config-flavor")) {
$flavor_array = file("{$g['etc_path']}/default-config-flavor");
OpenPOWER on IntegriCloud