[Pkg-nagios-changes] [pkg-nagios] r1074 - nagios-plugins/trunk/debian

Sean Finney seanius at alioth.debian.org
Wed Dec 6 22:55:29 CET 2006


Author: seanius
Date: 2006-12-06 22:55:29 +0100 (Wed, 06 Dec 2006)
New Revision: 1074

Modified:
   nagios-plugins/trunk/debian/functions
Log:
test for file before md5summing it

Modified: nagios-plugins/trunk/debian/functions
===================================================================
--- nagios-plugins/trunk/debian/functions	2006-12-06 21:52:25 UTC (rev 1073)
+++ nagios-plugins/trunk/debian/functions	2006-12-06 21:55:29 UTC (rev 1074)
@@ -6,9 +6,13 @@
 # determine whether the file is the default file shipped in sarge
 # (called as is_pristine_sarge_file foo.cfg)
 is_pristine_sarge_file(){
-	sargemd5=`grep "${npconfdir}/$1" ${npdpkgdir}/sarge.md5sums | cut -d' ' -f1`
-	curmd5=`md5sum "${npconfdir}/$1" | cut -d' ' -f1`
-	if [ "$curmd5" = "$sargemd5" ]; then return 0; else return 1; fi
+	cfg="${npconfdir}/$1"
+	if [ -f "$cfg" ]; then
+		sargemd5=`grep "$cfg" ${npdpkgdir}/sarge.md5sums | cut -d' ' -f1`
+		curmd5=`md5sum "$cfg" | cut -d' ' -f1`
+		if [ "$curmd5" = "$sargemd5" ]; then return 0; fi
+	fi
+	return 1
 }
 
 # we now register all n-p config files via ucf.  this means




More information about the Pkg-nagios-changes mailing list