diff options
author | Bill Marquette <billm@pfsense.org> | 2005-03-20 05:24:43 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-03-20 05:24:43 +0000 |
commit | d05dff823fd7bad3e74ffe41f63d84c15ff87b4b (patch) | |
tree | 5341728c5b5ac597511cf7b42ff9257b336ead67 /etc | |
parent | 6fc886821d98aaacbcfb0ddbfe4c6f27aca3fb3a (diff) | |
download | pfsense-d05dff823fd7bad3e74ffe41f63d84c15ff87b4b.zip pfsense-d05dff823fd7bad3e74ffe41f63d84c15ff87b4b.tar.gz |
Only write_config() if we actually upgraded config file versions (this should always happen if the functino
gets called) and log what file version we migrated from and to.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 28f91dc..e594240 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -228,6 +228,9 @@ function convert_config() { if ($g['booting']) echo "Converting configuration... "; + // Save off config version + $prev_version = $config['version']; + /* convert 1.0 -> 1.1 */ if ($config['version'] == "1.0") { $opti = 1; @@ -478,14 +481,15 @@ function convert_config() { $config['version'] = "1.6"; } - write_config(); + if ($prev_version != $config['version']) + write_config("Upgraded firmware from {$prev_version} to {$config['version']}"); if ($g['booting']) echo "done\n"; } /* save the system configuration */ -function write_config($desc="system created") { +function write_config($desc="Non-described system change") { global $config, $g; $lastchange = $config['lastchange']; |