summaryrefslogtreecommitdiffstats
path: root/etc/rc.prunecaptiveportal
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-02-11 11:05:07 +0000
committerErmal <eri@pfsense.org>2013-02-11 11:05:07 +0000
commit8135f01f456b91a881d0d1fea67c7f60981fd7e5 (patch)
tree1c7b0660004bf61ecc780214005812cdfa4d6420 /etc/rc.prunecaptiveportal
parent21d1560f6f53b048feabfdf4e29aa0dfd371ec42 (diff)
downloadpfsense-8135f01f456b91a881d0d1fea67c7f60981fd7e5.zip
pfsense-8135f01f456b91a881d0d1fea67c7f60981fd7e5.tar.gz
If more than 2 minutes have passed from the prunning process ignore the lock
Diffstat (limited to 'etc/rc.prunecaptiveportal')
-rwxr-xr-xetc/rc.prunecaptiveportal9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/rc.prunecaptiveportal b/etc/rc.prunecaptiveportal
index 3a8620f..12b0bce 100755
--- a/etc/rc.prunecaptiveportal
+++ b/etc/rc.prunecaptiveportal
@@ -43,8 +43,13 @@ global $g;
$cpzone = str_replace("\n", "", $argv[1]);
if (file_exists("{$g['tmp_path']}/.rc.prunecaptiveportal.{$cpzone}.running")) {
- log_error("Skipping CP prunning process because previous/another instance is already running");
- return;
+ $stat = stat("{$g['tmp_path']}/.rc.prunecaptiveportal.{$cpzone}.running");
+ if (time() - $stat['mtime'] >= 120)
+ @unlink("{$g['tmp_path']}/.rc.prunecaptiveportal.{$cpzone}.running");
+ else {
+ log_error("Skipping CP prunning process because previous/another instance is already running");
+ return;
+ }
}
@file_put_contents("{$g['tmp_path']}/.rc.prunecaptiveportal.{$cpzone}.running", "");
OpenPOWER on IntegriCloud