aboutsummaryrefslogtreecommitdiff
path: root/network/chrony/doinst.sh
diff options
context:
space:
mode:
authorRichard Ellis <rellis@dp100.com>2018-03-25 23:36:50 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-03-31 07:41:29 +0700
commit34ddf9962a566af57ce230b4264750794f80f1b0 (patch)
tree75b49d30346c9760a272a1bc2e11957741d64e1d /network/chrony/doinst.sh
parentfa2c523d76e4112a42203b1efaac971561fbda8d (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.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/network/chrony/doinst.sh b/network/chrony/doinst.sh
new file mode 100644
index 000000000000..21cb7905f628
--- /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