From b9f6677017bb21079675e1981ce0718014235318 Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 11 Feb 2013 11:03:24 +0000 Subject: If more than 2 minutes have passed from the prunning process ignore the lock --- etc/rc.prunecaptiveportal | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'etc') 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", ""); -- cgit v1.1