diff --git a/CHANGELOG b/CHANGELOG index 6cbe1675..a05b6cbd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,9 +4,14 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.4.1) 06/30/2005 +Fail2Ban (version 0.?.?) ??/??/2005 ============================================================= +ver. 0.?.? (??/??/2005) - ??? +---------- +- Added an initd script for RedHat/Fedora. Thanks to Andrey + G. Grozin + ver. 0.4.1 (06/30/2005) - stable ---------- - Fixed textToDNS method which generated wrong matches for diff --git a/config/redhat-initd b/config/redhat-initd new file mode 100644 index 00000000..27369962 --- /dev/null +++ b/config/redhat-initd @@ -0,0 +1,78 @@ +#!/bin/bash +# +# fail2ban +# +# chkconfig: 345 91 9 +# description: if many unsuccessfull login attempts from some ip address \ +# during a short period happen, this address is banned \ +# by the firewall +# +# Author: Andrey G. Grozin +# +# $Revision$ + +# Source function library. +. /etc/init.d/functions + +# Get config. +. /etc/sysconfig/network + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 +[ -f /etc/fail2ban.conf ] || exit 0 + +FAIL2BAN="/usr/bin/fail2ban.py" +PIDFILE="/var/run/fail2ban.pid" + +RETVAL=0 + +start() { + echo -n $"Starting fail2ban: " + "${FAIL2BAN}" -b + RETVAL=$? + echo +} + +stop() { + if [ -f "${PIDFILE}" ]; then + echo -n $"Stopping fail2ban: " + "${FAIL2BAN}" -k + echo + fi +} + +restart() { + stop + start +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status fail2ban.py + RETVAL=$? + ;; + reload) + restart + ;; + restart) + restart + ;; + condrestart) + if [ -f "${PIDFILE}" ]; then + restart + fi + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + exit 1 + ;; +esac + +exit $RETVAL