summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-05-24 10:05:07 +0100
committerStephen Beaver <sbeaver@netgate.com>2016-06-22 11:12:18 -0400
commit6ba90672ea07980731f3ddceb7f1f531319c1e8f (patch)
treee55d6b11099cdad58495a5b48e2fbe6d12f85fbb /src
parentfdda7af6f2f3adc6b8491c244d151218f75cfd20 (diff)
downloadpfsense-6ba90672ea07980731f3ddceb7f1f531319c1e8f.zip
pfsense-6ba90672ea07980731f3ddceb7f1f531319c1e8f.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 (cherry picked from commit 09a283948eada745bc10b852e63b7dec50fb69d4)
Diffstat (limited to 'src')
-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 1f351f4..f47b759 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