From 96169347eca3efb7b4770d9790449405a8c1432c Mon Sep 17 00:00:00 2001 From: Herton Ronaldo Krzesinski Date: Fri, 19 Aug 2005 19:06:06 +0000 Subject: - 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). --- add-syslog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'add-syslog') 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 -- cgit v1.2.1