Update of /cvsroot/devil-linux/build/scripts/scripts
In directory vz-cvs-3.sog:/tmp/cvs-serv3893/scripts
Added Files:
fail2ban
Log Message:
added fail2ban init script
--- NEW FILE: fail2ban ---
#!/bin/bash
#
# $Source: /cvsroot/devil-linux/build/scripts/scripts/fail2ban,v $
# $Revision: 1.1 $
# $Date: 2011/12/17 19:36:39 $
#
# http://www.devil-linux.org
#
### BEGIN INIT INFO
# Provides: fail2ban
# Required-Start: $network $syslog $named postfix
# Required-Stop: $network $syslog $named
# Default-Start:
# Default-Stop:
# Description: starts fail2ban
### END INIT INFO
# settings
source /etc/sysconfig/config
# parameters
NAME="fail2ban"
CONFIGNAME=FAIL2BAN
DAEMON=/usr/bin/fail2ban-client
PARAMETER=
# source function library
source /etc/init.d/functions
eval START=\$START_$CONFIGNAME
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test $link = $base && START=yes
test "$START" = "yes" || exit 0
if [ ! -e $DAEMON ]; then
echo
echo "$DAEMON not found. Did you install the package?"
exit 1
fi
case "$1" in
start)
echo -n "Starting $NAME: "
$DAEMON start > /dev/null
evaluate_retval
;;
stop)
echo -n "Shutting down $NAME: "
$DAEMON stop > /dev/null
evaluate_retval
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
|