aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-18 10:36:11 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-18 10:36:11 +0200
commit0a83b504c8a2d469c1d7ac056b42f136e92b87d5 (patch)
tree95d81ff332282fc9d6b54f2590e2d24fafe6601a /config
parent8592c78efe4ec9b29bfb26890bac47d542da17c7 (diff)
downloadpfsense-packages-0a83b504c8a2d469c1d7ac056b42f136e92b87d5.tar.gz
pfsense-packages-0a83b504c8a2d469c1d7ac056b42f136e92b87d5.tar.bz2
pfsense-packages-0a83b504c8a2d469c1d7ac056b42f136e92b87d5.zip
Unlink and recreate the conf file symlink on every reconfiguration
Just in case users shuffle interfaces assignment somehow....
Diffstat (limited to 'config')
-rw-r--r--config/ipguard/ipguard.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/ipguard/ipguard.inc b/config/ipguard/ipguard.inc
index bbef02e4..272e4d31 100644
--- a/config/ipguard/ipguard.inc
+++ b/config/ipguard/ipguard.inc
@@ -72,7 +72,11 @@ function ipguard_custom_php_write_config() {
$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3);
if ($pfs_version == "2.2") {
$conf_file_link = "/usr/pbi/ipguard-" . php_uname("m") . "/local/etc/ipguard_{$key}.conf";
- @symlink($conf_file, $conf_file_link);
+ /* Better recreate this every time just in case users shuffle interfaces assignment somehow */
+ if (is_link($conf_file_link)) {
+ unlink($conf_file_link);
+ }
+ symlink($conf_file, $conf_file_link);
}
$iface = convert_friendly_interface_to_real_interface_name($key);
$start .= "/usr/local/sbin/ipguard -l /var/log/ipguard_{$key}.log -p /var/run/ipguard_{$key}.pid -f {$conf_file} -u 300 -z {$iface}\n\t";