Project

General

Profile

« Previous | Next » 

Revision 6ba90672

Added by Stilez y about 9 years ago

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)

View differences:

src/etc/inc/globals.inc
151 151
	if ($g['platform'] == "nanobsd") {
152 152
		$g['firmware_update_text']="pfSense-*.img.gz";
153 153
		$g['hidebackupbeforeupgrade'] = true;
154

  
154
		$g['default_config_backup_count'] = 5;
155 155
	} else {
156 156
		$g['firmware_update_text']="pfSense-*.tgz";
157
		$g['default_config_backup_count'] = 30;
157 158
	}
158
}
159
} else { 
160
	// shouldn't happen but "just in case" no platform were detected 
161
	$g['platform'] = 'undetected'; 
162
	$g['default_config_backup_count'] = 30; 
163
} 
164

  
159 165

  
160 166
if (file_exists("{$g['etc_path']}/default-config-flavor")) {
161 167
	$flavor_array = file("{$g['etc_path']}/default-config-flavor");

Also available in: Unified diff