aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2015-02-05 00:15:28 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2015-02-05 00:15:28 +0100
commit799dff29d145afc07c51833d5b647cf21e66efd2 (patch)
treefdc278ce7634daba826cd51ea9f3e035ecf69c84 /config
parente434534dad51e6306eb2c3401cd8ce72295618e8 (diff)
downloadpfsense-packages-799dff29d145afc07c51833d5b647cf21e66efd2.tar.gz
pfsense-packages-799dff29d145afc07c51833d5b647cf21e66efd2.tar.bz2
pfsense-packages-799dff29d145afc07c51833d5b647cf21e66efd2.zip
tinc, fix2 for re-installation, while performing a pfSense firmware upgrade.
Diffstat (limited to 'config')
-rw-r--r--config/tinc/tinc.inc23
1 files changed, 22 insertions, 1 deletions
diff --git a/config/tinc/tinc.inc b/config/tinc/tinc.inc
index 8b2b671c..717ce967 100644
--- a/config/tinc/tinc.inc
+++ b/config/tinc/tinc.inc
@@ -1,6 +1,27 @@
<?php
-include_once('guiconfig.inc'); // needed for clear_log_file() during package installation while booting
+if (!function_exists('clear_log_file')) {
+//include_once('guiconfig.inc'); // needed for clear_log_file() during package installation while booting
+//however guiconfig.inc includes authgui.inc which requires a valid php session_auth(), and exits when not found..
+//so include the function here..
+ function clear_log_file($logfile = "/var/log/system.log", $restart_syslogd = true) {
+ global $config, $g;
+ if ($restart_syslogd)
+ exec("/usr/bin/killall syslogd");
+ if(isset($config['system']['disablesyslogclog'])) {
+ unlink($logfile);
+ touch($logfile);
+ } else {
+ $log_size = isset($config['syslog']['logfilesize']) ? $config['syslog']['logfilesize'] : "511488";
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_create -s {$log_size} " . escapeshellarg($logfile));
+ else
+ exec("/usr/local/sbin/clog -i -s {$log_size} " . escapeshellarg($logfile));
+ }
+ if ($restart_syslogd)
+ system_syslogd_start();
+ }
+}
function tinc_save() {
global $config;