summaryrefslogtreecommitdiff
path: root/system/monit/doinst.sh
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-02-20 00:18:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-02-20 00:18:51 +0700
commit6c9e39f8c15daf0fa5caa731850fc5f21f17cd1b (patch)
tree3b0e970a453ff5de26ccfd890826cde4851cfc11 /system/monit/doinst.sh
parent7359576c971fa7905337f08160effcb8dc254b5e (diff)
downloadslackbuilds-6c9e39f8c15daf0fa5caa731850fc5f21f17cd1b.tar.gz
system/monit: Updated for version 5.16.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/monit/doinst.sh')
-rw-r--r--system/monit/doinst.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/system/monit/doinst.sh b/system/monit/doinst.sh
index 1a24db5994..293507cbb1 100644
--- a/system/monit/doinst.sh
+++ b/system/monit/doinst.sh
@@ -11,12 +11,17 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.monit.new:
-if [ -e etc/rc.d/rc.monit ]; then
- cp -a etc/rc.d/rc.monit etc/rc.d/rc.monit.new.incoming
- cat etc/rc.d/rc.monit.new > etc/rc.d/rc.monit.new.incoming
- mv etc/rc.d/rc.monit.new.incoming etc/rc.d/rc.monit.new
-fi
+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
+}
-config etc/rc.d/rc.monit.new
+preserve_perms etc/rc.d/rc.monit.new
+config etc/monit.conf.new