slackbuilds_ponce/network/geoipupdate/doinst.sh
Oleg A. Deordiev 9727e91f36 network/geoipupdate: Added (GeoIP Updater).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2014-12-01 00:57:48 +07: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/GeoIP.conf.new