From cc961fa42056210e2fcf5a5418cc41d946de94c7 Mon Sep 17 00:00:00 2001 From: dsomero Date: Wed, 23 Mar 2011 18:18:41 -0400 Subject: [PATCH] network/mod_evasive: Handle .new files correctly. Signed-off-by: dsomero --- network/mod_evasive/doinst.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/network/mod_evasive/doinst.sh b/network/mod_evasive/doinst.sh index 5077bf363e..3183a8b24c 100644 --- a/network/mod_evasive/doinst.sh +++ b/network/mod_evasive/doinst.sh @@ -11,5 +11,16 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -config etc/httpd/mod_evasive.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_evasive.conf.new