slackbuilds_ponce/ruby/facter/doinst.sh
Thibaut Notteboom b9ecc66854 ruby/facter: Updated for version 1.6.17.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2013-02-22 22:27:44 -06:00

14 lines
375 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/facter.conf.new