diff options
author | Robby Workman <rworkman@slackbuilds.org> | 2010-05-19 12:59:14 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-21 01:19:54 -0500 |
commit | 2840cc6b1fd9eaa866c3c9c1c8ef0f213604ba08 (patch) | |
tree | ad846c30780ff730ee69e49ef70045b50eec9f8b /network/openntpd/doinst.sh | |
parent | 46ad2866eabe16b466e1c4023b48b19747855f04 (diff) | |
download | slackbuilds-2840cc6b1fd9eaa866c3c9c1c8ef0f213604ba08.tar.gz |
network/openntpd: Miscellaneous cleanups.
Diffstat (limited to 'network/openntpd/doinst.sh')
-rw-r--r-- | network/openntpd/doinst.sh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/network/openntpd/doinst.sh b/network/openntpd/doinst.sh index d1589f1e71..27ac593f97 100644 --- a/network/openntpd/doinst.sh +++ b/network/openntpd/doinst.sh @@ -11,13 +11,17 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.ntpd.new: -if [ -e etc/rc.d/rc.ntpd ]; then - cp -a etc/rc.d/rc.ntpd etc/rc.d/rc.ntpd.new.incoming - cat etc/rc.d/rc.ntpd.new > etc/rc.d/rc.ntpd.new.incoming - mv etc/rc.d/rc.ntpd.new.incoming etc/rc.d/rc.ntpd.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.ntpd.new +preserve_perms etc/rc.d/rc.ntpd.new config etc/ntpd.conf.new |