diff options
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 d1589f1e711d..27ac593f979d 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 |