slackbuilds_ponce/network/cacti-spine/doinst.sh
Thibaut Notteboom 7efc0bc77a network/cacti-spine: Added (poller for Cacti).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
2013-01-20 09:03:05 -05:00

14 lines
374 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/spine.conf.new