diff options
author | jim-p <jimp@pfsense.org> | 2015-02-07 15:37:25 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-02-07 15:37:25 -0500 |
commit | 89467ec8353b37d7bf448576b75c7f160f67b5e0 (patch) | |
tree | 906e1c9c85a73cd99971898df745e390a0d097ef /config | |
parent | 975b2b67b8a42f19ce2e9bc646e4ca4472722f3d (diff) | |
parent | 799dff29d145afc07c51833d5b647cf21e66efd2 (diff) | |
download | pfsense-packages-89467ec8353b37d7bf448576b75c7f160f67b5e0.tar.gz pfsense-packages-89467ec8353b37d7bf448576b75c7f160f67b5e0.tar.bz2 pfsense-packages-89467ec8353b37d7bf448576b75c7f160f67b5e0.zip |
Merge pull request #811 from PiBa-NL/tinc_install
Diffstat (limited to 'config')
-rw-r--r-- | config/tinc/tinc.inc | 23 |
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; |