summaryrefslogtreecommitdiff
path: root/network/fail2ban/doinst.sh
diff options
context:
space:
mode:
authorNishant Limbachia <nishant@mnspace.net>2011-12-25 10:33:11 -0200
committerRobby Workman <rworkman@slackbuilds.org>2011-12-27 10:15:06 -0600
commit32cb46a3aa7012c2fca392ec3dd12769be3efb10 (patch)
treecfa4460961e0b75636a3a45581146c27e68a2e59 /network/fail2ban/doinst.sh
parent18dd0cddaa6b89ec26fd7e4126b3d1fc108c70b8 (diff)
downloadslackbuilds-32cb46a3aa7012c2fca392ec3dd12769be3efb10.tar.gz
network/fail2ban: Updated for version 0.8.6.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/fail2ban/doinst.sh')
-rw-r--r--network/fail2ban/doinst.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/network/fail2ban/doinst.sh b/network/fail2ban/doinst.sh
index 5a77f216e6..f6a20b4af0 100644
--- a/network/fail2ban/doinst.sh
+++ b/network/fail2ban/doinst.sh
@@ -11,14 +11,18 @@ config() {
# Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.fail2ban.new:
-if [ -e etc/rc.d/rc.fail2ban ]; then
- cp -a etc/rc.d/rc.fail2ban etc/rc.d/rc.fail2ban.new.incoming
- cat etc/rc.d/rc.fail2ban.new > etc/rc.d/rc.fail2ban.new.incoming
- mv etc/rc.d/rc.fail2ban.new.incoming etc/rc.d/rc.fail2ban.new
-fi
+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
+}
-config etc/rc.d/rc.fail2ban.new
+preserve_perms etc/rc.d/rc.fail2ban.new
config etc/logrotate.d/fail2ban.new
config etc/fail2ban/fail2ban.conf.new
config etc/fail2ban/jail.conf.new