source: npl/monitoring/fail2ban/doinst.sh @ 26ffad7

Last change on this file since 26ffad7 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 910 bytes
Line 
1config() {
2  NEW="$1"
3  OLD="$(dirname $NEW)/$(basename $NEW .new)"
4  # If there's no config file by that name, mv it over:
5  if [ ! -r $OLD ]; then
6    mv $NEW $OLD
7  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
8    # toss the redundant copy
9    rm $NEW
10  fi
11  # Otherwise, we leave the .new copy for the admin to consider...
12}
13
14# Keep same perms on rc.fail2ban.new:
15if [ -e etc/rc.d/rc.fail2ban ]; then
16  cp -a etc/rc.d/rc.fail2ban etc/rc.d/rc.fail2ban.new.incoming
17  cat etc/rc.d/rc.fail2ban.new > etc/rc.d/rc.fail2ban.new.incoming
18  mv etc/rc.d/rc.fail2ban.new.incoming etc/rc.d/rc.fail2ban.new
19fi
20
21config etc/rc.d/rc.fail2ban.new
22config etc/logrotate.d/fail2ban.new
23config etc/fail2ban/fail2ban.conf.new
24config etc/fail2ban/jail.conf.new
25
26for conf_file in etc/fail2ban/action.d/*.new; do
27  config $conf_file
28done
29for conf_file in etc/fail2ban/filter.d/*.new; do
30  config $conf_file
31done
Note: See TracBrowser for help on using the repository browser.