summaryrefslogtreecommitdiff
path: root/system/nagvis/doinst.sh
diff options
context:
space:
mode:
authorMario Preksavec <mario at slackware dot hr>2015-02-28 03:51:03 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-02-28 03:51:03 +0700
commit31fe02463cf8054480f246e493cb15c6a39a900b (patch)
tree7ef37f7b69fe05b2b757eec01f81d9b15f211cff /system/nagvis/doinst.sh
parent0e26246f8d113e72de0643505aea9fd8bb92ccdf (diff)
downloadslackbuilds-31fe02463cf8054480f246e493cb15c6a39a900b.tar.gz
system/nagvis: Added (visualization addon for Nagios or Icinga).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/nagvis/doinst.sh')
-rw-r--r--system/nagvis/doinst.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/system/nagvis/doinst.sh b/system/nagvis/doinst.sh
new file mode 100644
index 0000000000..c4c7712d71
--- /dev/null
+++ b/system/nagvis/doinst.sh
@@ -0,0 +1,17 @@
+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...
+}
+
+config etc/httpd/extra/nagvis.conf.new
+
+find etc/nagvis -type f -name '*.new' \
+ | while read new ; do config $new ; done