slackbuilds_ponce/system/ansible/doinst.sh
Alex Diaconu 5235ca2587 system/ansible: Updated for version 1.2.1.
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
2013-07-18 15:08:08 -05:00

15 lines
438 B
Bash

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...
}
config etc/ansible/ansible.cfg.new
config etc/ansible/hosts.new