diff options
author | Mario Preksavec <mario@slackware.hr> | 2017-09-25 11:39:41 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-09-30 07:19:35 +0700 |
commit | af149b3737645ac9eca576de165cd8a1bc474d0a (patch) | |
tree | 67ced2184695051d905922d3072fd28b968e0c29 /network/nagios/doinst.sh | |
parent | 07efe8658c0f31705c451fef8907bde9cc85e8a9 (diff) |
network/nagios: Updated for version 4.3.4.
Signed-off-by: Mario Preksavec <mario@slackware.hr>
Diffstat (limited to 'network/nagios/doinst.sh')
-rw-r--r-- | network/nagios/doinst.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/network/nagios/doinst.sh b/network/nagios/doinst.sh index 4dd7fba9f9269..03d95781a1202 100644 --- a/network/nagios/doinst.sh +++ b/network/nagios/doinst.sh @@ -11,14 +11,19 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.nagios.new: -if [ -e etc/rc.d/rc.nagios ]; then - cp -a etc/rc.d/rc.nagios etc/rc.d/rc.nagios.new.incoming - cat etc/rc.d/rc.nagios.new > etc/rc.d/rc.nagios.new.incoming - mv etc/rc.d/rc.nagios.new.incoming etc/rc.d/rc.nagios.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 +} + +preserve_perms etc/rc.d/rc.nagios.new find etc/nagios/ -name *.cfg.new | while read cfg ; do config $cfg ; done config etc/httpd/extra/nagios.conf.new -config etc/rc.d/rc.nagios.new |