diff options
author | Ermal <eri@pfsense.org> | 2013-02-11 11:03:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-02-11 11:03:24 +0000 |
commit | b9f6677017bb21079675e1981ce0718014235318 (patch) | |
tree | 925565954d5db68cf814e8cfb016fa30e9bbca95 /etc | |
parent | b16d70ebb133b1bf1ba0429d5d8b98698d670bd6 (diff) | |
download | pfsense-b9f6677017bb21079675e1981ce0718014235318.zip pfsense-b9f6677017bb21079675e1981ce0718014235318.tar.gz |
If more than 2 minutes have passed from the prunning process ignore the lock
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.prunecaptiveportal | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/rc.prunecaptiveportal b/etc/rc.prunecaptiveportal index 346ed41..04366ea 100755 --- a/etc/rc.prunecaptiveportal +++ b/etc/rc.prunecaptiveportal @@ -41,8 +41,13 @@ 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; + $stat = stat("{$g['tmp_path']}/.rc.prunecaptiveportal.running"); + if (time() - $stat['mtime'] >= 120) + @unlink("{$g['tmp_path']}/.rc.prunecaptiveportal.running"); + else { + log_error("Skipping CP prunning process because previous/another instance is already running"); + return; + } } @file_put_contents("{$g['tmp_path']}/.rc.prunecaptiveportal.running", ""); |