summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-04-27 00:13:27 +0000
committerColin Smith <colin@pfsense.org>2005-04-27 00:13:27 +0000
commit9aad5f60ba14f4d59a3dbf60fbbbfd8987294d9f (patch)
treec199dd7eb6989a0c0679888238e5f10bd0f5fe24 /usr
parentb8c56a9edbd238cfcedf8f2a3dc58b717ae715a8 (diff)
downloadpfsense-9aad5f60ba14f4d59a3dbf60fbbbfd8987294d9f.zip
pfsense-9aad5f60ba14f4d59a3dbf60fbbbfd8987294d9f.tar.gz
Add an option to ignore package log entries. This has the convenient side effect of moving package installation and deletion messages to the package log page (if it's defined) while moving them back to the main log page upon deinstallation.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/guiconfig.inc24
1 files changed, 19 insertions, 5 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 61b5887..f0a83e9 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -454,13 +454,25 @@ function update_changedesc($update) {
$changecount++;
}
-function dump_clog($logfile, $tail, $grepfor = "", $grepinvert = false, $withorig = true) {
+function dump_clog($logfile, $tail, $grepfor = "", $grepinvert = false, $withorig = true, $ignorepkgs = true) {
global $g, $config;
-
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
-
exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
if(!is_array($grepfor)) $grepfor = array($grepfor);
+ if(!is_array($grepinvert)) $grepinvert = array($grepinvert);
+ if($ignorepkgs == true and $config['installedpackages']['package'] != "") {
+ foreach($config['installedpackages']['package'] as $pkg) {
+ $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $pkg['configurationfile'], "packagegui");
+ if($pkg_config['logging'] != "" and $pkg_config['logging']['grepfor'] != "") {
+ $grepfor[] = $pkg_config['logging']['grepfor'];
+ if($pkg_config['logging']['grepinvert'] != "") {
+ $grepinvert[] = $pkg_config['logging']['grepinvert'];
+ } else {
+ $grepinvert[] = true;
+ }
+ }
+ }
+ }
if($grepfor <> "") {
$i = 0;
foreach($grepfor as $agrep) {
@@ -523,11 +535,13 @@ function download_file_with_progress_bar($url_file, $destination_file) {
curl_exec($ch);
fclose($fout);
curl_close($ch);
- return 1;
- if ($error = curl_error($ch)) {
+ if ($error = curl_error($ch)) {
+ print $error;
return -1;
}
+
+ return 1;
}
function read_header($ch, $string) {
OpenPOWER on IntegriCloud