packages: nagios-nsca/nagios-nsca.submit - use awk instead of grep - errors...

glen glen at pld-linux.org
Tue Aug 4 08:19:29 CEST 2009


Author: glen                         Date: Tue Aug  4 06:19:29 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- use awk instead of grep
- errors to stderr

---- Files affected:
packages/nagios-nsca:
   nagios-nsca.submit (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: packages/nagios-nsca/nagios-nsca.submit
diff -u packages/nagios-nsca/nagios-nsca.submit:1.5 packages/nagios-nsca/nagios-nsca.submit:1.6
--- packages/nagios-nsca/nagios-nsca.submit:1.5	Fri Jul  7 15:55:29 2006
+++ packages/nagios-nsca/nagios-nsca.submit	Tue Aug  4 08:19:24 2009
@@ -27,14 +27,14 @@
 	TYPE=HOST
 	CODE=$2
 else
-	echo "You must specify exactly 3 or 4 arguments"
+	echo >&2 "You must specify exactly 3 or 4 arguments"
 	exit 1
 fi
 
-CENTRAL=`cat /etc/nagios/send_nsca-central 2>/dev/null | grep -v '^#'`
+CENTRAL=$(awk '!/#/ { print }' /etc/nagios/send_nsca-central)
 
 if [ -z $CENTRAL ]; then
-	echo "You must specify nagios NSCA host in /etc/nagios/send_nsca-central"
+	echo >&2 "You must specify nagios NSCA host in /etc/nagios/send_nsca-central"
 	exit 1
 fi
 
@@ -74,6 +74,6 @@
 elif [ "$TYPE" = "HOST" ]; then
 	echo -e "$1\t$RETURN_CODE\t$3\n" | /usr/sbin/send_nsca $CENTRAL -c /etc/nagios/send_nsca.cfg
 else
-	echo "This cannot happen"
+	echo >&2 "This cannot happen"
 	exit 1
 fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-nsca/nagios-nsca.submit?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list