network/mod_geoip2: Handle .new files correctly.

Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
This commit is contained in:
dsomero 2011-03-23 18:19:25 -04:00 committed by Robby Workman
parent cc961fa420
commit e821e5f6f8

View file

@ -11,5 +11,15 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/httpd/mod_geoip.conf.new
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/httpd/extra/mod_geoip.conf.new