aboutsummaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authordsomero <xgizzmo@slackbuilds.org>2011-03-23 18:18:41 -0400
committerRobby Workman <rworkman@slackbuilds.org>2011-03-24 19:23:16 -0500
commitcc961fa42056210e2fcf5a5418cc41d946de94c7 (patch)
tree9c462c4e0ab0e7be1e7bdb50504258faaf98f4a4 /network
parent279057af5c4a2a47a4f1beaed06f9f348256062a (diff)
network/mod_evasive: Handle .new files correctly.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network')
-rw-r--r--network/mod_evasive/doinst.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/network/mod_evasive/doinst.sh b/network/mod_evasive/doinst.sh
index 5077bf363ed0..3183a8b24c37 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