From e821e5f6f8667c89f7910f88f904e3d103ba97a0 Mon Sep 17 00:00:00 2001 From: dsomero Date: Wed, 23 Mar 2011 18:19:25 -0400 Subject: network/mod_geoip2: Handle .new files correctly. Signed-off-by: dsomero --- network/mod_geoip2/doinst.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/network/mod_geoip2/doinst.sh b/network/mod_geoip2/doinst.sh index 83bf461e9e..ad529d2fa6 100644 --- a/network/mod_geoip2/doinst.sh +++ b/network/mod_geoip2/doinst.sh @@ -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 \ No newline at end of file -- cgit v1.2.3