summaryrefslogtreecommitdiffstats
path: root/system/icinga-web/doinst.sh
diff options
context:
space:
mode:
author Mario Preksavec2015-02-27 21:57:26 +0100
committer Willy Sudiarto Raharjo2015-02-27 21:57:26 +0100
commitaed17a6c544739845ed718bb505a547ba152940f (patch)
tree0427e03f4c279c99bdb27fd9b1b5bd56961f6eed /system/icinga-web/doinst.sh
parent639af5e6850658099986e3f29539ee001ee08d50 (diff)
downloadslackbuilds-aed17a6c544739845ed718bb505a547ba152940f.tar.gz
system/icinga-web: Added (Network resource monitoring Web UI).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/icinga-web/doinst.sh')
-rw-r--r--system/icinga-web/doinst.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/system/icinga-web/doinst.sh b/system/icinga-web/doinst.sh
new file mode 100644
index 0000000000..54934b61ec
--- /dev/null
+++ b/system/icinga-web/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/icinga-web.conf.new
+
+find etc/icinga-web -type f -name '*.new' \
+ | while read new ; do config $new ; done