Commit 7fd322f1 authored by Franco Fichtner's avatar Franco Fichtner

rc: tmp_path removal

parent 0fa44def
......@@ -158,8 +158,9 @@ echo "done.\n";
while(is_interface_mismatch() == true) {
led_assigninterfaces();
if (isset($config['revision'])) {
if (file_exists("{$g['tmp_path']}/missing_interfaces"))
echo "Warning: Configuration references interfaces that do not exist: " . file_get_contents("{$g['tmp_path']}/missing_interfaces") . "\n";
if (file_exists('/tmp/missing_interfaces')) {
echo "Warning: Configuration references interfaces that do not exist: " . file_get_contents('/tmp/missing_interfaces') . "\n";
}
echo "\nNetwork interface mismatch -- Running interface assignment option.\n";
} else
echo "\nDefault interfaces not found -- Running interface assignment option.\n";
......
......@@ -2,8 +2,6 @@
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
......@@ -29,8 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
/* config.inc retrives the util.inc and globals.inc */
require_once("config.inc");
require_once("functions.inc");
require_once("filter.inc");
......@@ -42,21 +38,26 @@ global $cpzone;
global $cpzoneid;
$cpzone = str_replace("\n", "", $argv[1]);
if (!is_array($config['captiveportal'][$cpzone])) {
log_error("{$cpzone} is not a valid zone in the configuration!");
return;
}
$cpzoneid = $config['captiveportal'][$cpzone]['zoneid'];
if (file_exists("{$g['tmp_path']}/.rc.prunecaptiveportal.running")) {
$stat = stat("{$g['tmp_path']}/.rc.prunecaptiveportal.running");
if (time() - $stat['mtime'] >= 120)
@unlink("{$g['tmp_path']}/.rc.prunecaptiveportal.running");
else {
if (file_exists('/tmp/.rc.prunecaptiveportal.running')) {
$stat = stat('/tmp/.rc.prunecaptiveportal.running');
if (time() - $stat['mtime'] >= 120) {
@unlink('/tmp/.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", "");
@file_put_contents('/tmp/.rc.prunecaptiveportal.running', '');
captiveportal_prune_old();
@unlink("{$g['tmp_path']}/.rc.prunecaptiveportal.running");
?>
@unlink('/tmp/.rc.prunecaptiveportal.running');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment