summaryrefslogtreecommitdiff
path: root/network/nsca/doinst.sh
diff options
context:
space:
mode:
authorBas Couwenberg <sebastic@xs4all.nl>2010-12-28 14:28:48 -0600
committerRobby Workman <rworkman@slackbuilds.org>2010-12-29 01:08:49 -0600
commit317811518be63939f7637b715ee95adcb28f7e2c (patch)
tree2b5c78b5352e7ce663799e666348655172a73f2b /network/nsca/doinst.sh
parent2cca181910818e6af4fa9c1e71cb9ae1718af3f7 (diff)
downloadslackbuilds-317811518be63939f7637b715ee95adcb28f7e2c.tar.gz
network/nsca: Added (Nagios Service Check Acceptor)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/nsca/doinst.sh')
-rw-r--r--network/nsca/doinst.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/network/nsca/doinst.sh b/network/nsca/doinst.sh
new file mode 100644
index 0000000000..ecaa1a5ad0
--- /dev/null
+++ b/network/nsca/doinst.sh
@@ -0,0 +1,28 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.nsca.new
+config etc/nagios/nsca.cfg.new
+config etc/nagios/send_nsca.cfg.new
+