summaryrefslogtreecommitdiffstats
path: root/system/munin-node/doinst.sh
diff options
context:
space:
mode:
author Jonathan Chapman <glitch@glitchwrks.com>2015-10-09 23:50:33 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2015-10-09 23:50:56 +0700
commitd5c65817b72ac6a07fa3fd21bf47b8b2e6f1108c (patch)
tree3525ea6c558fdff3bec910dc1ea97de71ae85d1e /system/munin-node/doinst.sh
parent1673835d5a699ff9292dd33bef731a44466bfc2b (diff)
downloadslackbuilds-d5c65817b72ac6a07fa3fd21bf47b8b2e6f1108c.tar.gz
slackbuilds-d5c65817b72ac6a07fa3fd21bf47b8b2e6f1108c.tar.xz
system/munin-node: Added (Statistics gathering client for Munin).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/munin-node/doinst.sh')
-rw-r--r--system/munin-node/doinst.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/system/munin-node/doinst.sh b/system/munin-node/doinst.sh
new file mode 100644
index 0000000000..6afcc2415d
--- /dev/null
+++ b/system/munin-node/doinst.sh
@@ -0,0 +1,30 @@
+# Post-install configuration scripts, borrowed from the fail2ban
+# Slackbuild:
+
+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.munin-node.new
+config etc/munin/munin-node.conf.new
+config etc/logrotate.d/munin-node.new