diff options
author | Ermal <eri@pfsense.org> | 2012-05-23 12:53:37 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-05-23 12:53:37 +0000 |
commit | 3807002ce5ae75b75bd81df64ff5d26af7b338a4 (patch) | |
tree | 6dcf72c55c415290a30e160c617df5c3df04a6df /etc | |
parent | 6b517c763fec48af1dc60f78881e772c058b85b4 (diff) | |
download | pfsense-3807002ce5ae75b75bd81df64ff5d26af7b338a4.zip pfsense-3807002ce5ae75b75bd81df64ff5d26af7b338a4.tar.gz |
Prevent 2 instances of rc.prunecaptiveportal from running in parallell since this might be a bad thing
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.prunecaptiveportal | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/rc.prunecaptiveportal b/etc/rc.prunecaptiveportal index 798b196..346ed41 100755 --- a/etc/rc.prunecaptiveportal +++ b/etc/rc.prunecaptiveportal @@ -38,6 +38,15 @@ require_once("filter.inc"); require_once("shaper.inc"); require_once("captiveportal.inc"); +global $g; + +if (file_exists("{$g['tmp_path']}/.rc.prunecaptiveportal.running")) { + log_error("Skipping CP prunning process because previous/another instance is already running"); + return; +} + +@file_put_contents("{$g['tmp_path']}/.rc.prunecaptiveportal.running", ""); captiveportal_prune_old(); +@unlink("{$g['tmp_path']}/.rc.prunecaptiveportal.running"); ?> |