SVN: nagios-config/trunk/package.sh

glen glen at pld-linux.org
Sun Oct 5 02:43:40 CEST 2008


Author: glen
Date: Sun Oct  5 02:43:40 2008
New Revision: 9894

Modified:
   nagios-config/trunk/package.sh
Log:
- different tarballs for nagios and nagios-plugins

Modified: nagios-config/trunk/package.sh
==============================================================================
--- nagios-config/trunk/package.sh	(original)
+++ nagios-config/trunk/package.sh	Sun Oct  5 02:43:40 2008
@@ -1,26 +1,37 @@
 #!/bin/sh
+set -e
 
-PN=nagios-config
 PV=$(date +%Y%m%d)
 
-files="
+archive() {
+	PN=$1; shift
+
+	s=0
+	pkg=$PN-$PV
+	while [ -f $pkg.tar.bz2 ]; do
+		s=$((s + 1))
+		pkg=$PN-$PV.$s
+	done
+
+	mkdir -p $pkg
+	cp -a --parents "$@" $pkg
+	tar cjf $pkg.tar.bz2 --exclude=.svn --remove-files $pkg
+	rm -rf $pkg
+
+	echo "Created: $pkg.tar.bz2"
+}
+
+files_base="
 contactgroups.cfg contacts.cfg dependencies.cfg
 escalations.cfg hostextinfo.cfg hostgroups.cfg hosts.cfg misccommands.cfg
 serviceextinfo.cfg services.cfg timeperiods.cfg
 
 nagios.cfg cgi.cfg resource.cfg
+
+commands/commands.cfg
 "
 
-s=0
-pkg=$PN-$PV
-while [ -f $pkg.tar.bz2 ]; do
-	s=$((s + 1))
-	pkg=$PN-$PV.$s
-done
-
-mkdir -p $pkg
-cp -a $files $pkg
-tar cjf $pkg.tar.bz2 --remove-files $pkg
-rmdir $pkg
+files_plugins="commands/check_*.cfg"
 
-echo "Created: $pkg.tar.bz2"
+archive nagios-config $files_base
+archive nagios-plugins-config $files_plugins


More information about the pld-cvs-commit mailing list