From 429e0911a0508ceb205be14e422ddf3793445a2c Mon Sep 17 00:00:00 2001 From: NOYB Date: Mon, 7 Dec 2015 17:14:54 -0800 Subject: Write Config Only Option Add write_config function option to only write the config. Sometimes syncing firewall is not necessary or desirable. ex: changing log display options. --- src/etc/inc/config.lib.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/etc') diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc index 0ea97b3..9eef685 100644 --- a/src/etc/inc/config.lib.inc +++ b/src/etc/inc/config.lib.inc @@ -515,7 +515,7 @@ function safe_write_file($file, $content, $force_binary) { * null ******/ /* save the system configuration */ -function write_config($desc="Unknown", $backup = true) { +function write_config($desc="Unknown", $backup = true, $write_config_only = false) { global $config, $g; if (!empty($_SERVER['REMOTE_ADDR'])) { @@ -580,6 +580,12 @@ function write_config($desc="Unknown", $backup = true) { unlock($lockkey); + if ($write_config_only) { + /* tell kernel to sync fs data */ + conf_mount_ro(); + return $config; + } + unlink_if_exists("/usr/local/pkg/pf/carp_sync_client.php"); /* tell kernel to sync fs data */ -- cgit v1.1