aboutsummaryrefslogtreecommitdiffstats
path: root/add-syslog
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2005-08-19 19:06:06 +0000
committerHerton Ronaldo Krzesinski <herton@mandriva.com.br>2005-08-19 19:06:06 +0000
commit96169347eca3efb7b4770d9790449405a8c1432c (patch)
tree3ef782f34142c78c89e4cb4e1ce3c53ef19caae7 /add-syslog
parent417615d96d52b8e011d5efbdff69f7216a53e194 (diff)
downloadrpm-helper-96169347eca3efb7b4770d9790449405a8c1432c.tar
rpm-helper-96169347eca3efb7b4770d9790449405a8c1432c.tar.gz
rpm-helper-96169347eca3efb7b4770d9790449405a8c1432c.tar.bz2
rpm-helper-96169347eca3efb7b4770d9790449405a8c1432c.tar.xz
rpm-helper-96169347eca3efb7b4770d9790449405a8c1432c.zip
- Fix bug when handling log entries comprised of all levels at syslog-ng
configuration file. - Correctly handle '*' character inside names of configuration tokes, not make it be interpreted like a shell wildcard or sed regular expression. - Fix bug when get source name inside add-syslog, in the case there isn't a different source, instead the default source /dev/log is used (the case where $source variable is empty).
Diffstat (limited to 'add-syslog')
-rwxr-xr-xadd-syslog4
1 files changed, 3 insertions, 1 deletions
diff --git a/add-syslog b/add-syslog
index d1d0918..c3f8da1 100755
--- a/add-syslog
+++ b/add-syslog
@@ -170,7 +170,9 @@ fi
if [ -f /etc/syslog-ng.conf ]; then
config=`sed "s/#.*$//g" /etc/syslog-ng.conf`
add_blank_line /etc/syslog-ng.conf
- if ! sed "s/#.*$//g" /etc/syslog-ng.conf | grep -q "$source"; then
+ if [ -z "$source" ]; then
+ from=`echo $config | sed -n "s:\(.*source[[:space:]]\+\)\([[:alnum:]]\+\)\(.*/dev/log.*\):\2:p"`
+ elif ! sed "s/#.*$//g" /etc/syslog-ng.conf | grep -q "$source"; then
if [ -n "$facility" -o -n "$level_begin" -a -n "$logfile" ]; then
echo "source $pkg { unix-stream (\"$source\"); };" >> /etc/syslog-ng.conf
from=$pkg