diff options
author | David Spencer <idlemoor@slackbuilds.org> | 2016-11-17 17:41:26 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-11-19 07:31:28 +0700 |
commit | 206336c0bcbffbdd89d55453feb6bf29dcb62243 (patch) | |
tree | 09f9a267edbe6cadb5b8dacdaf53bf220b4e7d42 /system/salt/doinst.sh | |
parent | 2d76c763409a2a6bb74a308faca8384ebabdc2e3 (diff) | |
download | slackbuilds-206336c0bcbffbdd89d55453feb6bf29dcb62243.tar.gz |
system/salt: Updated for version 2016.3.4.
Thanks to bjwebb.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/salt/doinst.sh')
-rw-r--r-- | system/salt/doinst.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/system/salt/doinst.sh b/system/salt/doinst.sh new file mode 100644 index 0000000000..7af961a5ca --- /dev/null +++ b/system/salt/doinst.sh @@ -0,0 +1,27 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +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.salt-master.new +preserve_perms etc/rc.d/rc.salt-minion.new +preserve_perms etc/rc.d/rc.salt-syndic.new |