diff options
author | Richard Ellis <rellis@dp100.com> | 2018-03-25 23:36:50 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-03-31 07:41:29 +0700 |
commit | 34ddf9962a566af57ce230b4264750794f80f1b0 (patch) | |
tree | 75b49d30346c9760a272a1bc2e11957741d64e1d /network/chrony/doinst.sh | |
parent | fa2c523d76e4112a42203b1efaac971561fbda8d (diff) |
network/chrony: Updated for version 3.2.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/chrony/doinst.sh')
-rw-r--r-- | network/chrony/doinst.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/network/chrony/doinst.sh b/network/chrony/doinst.sh new file mode 100644 index 0000000000000..21cb7905f6282 --- /dev/null +++ b/network/chrony/doinst.sh @@ -0,0 +1,23 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + rm $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/chrony.conf.new +preserve_perms etc/rc.d/rc.chrony.new |