summaryrefslogtreecommitdiff
path: root/network/fail2ban/rc.fail2ban
diff options
context:
space:
mode:
authorNishant Limbachia <nishant@mnspace.net>2010-05-13 00:36:23 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-13 00:36:23 +0200
commitbe48e858385bef134f4bcb7a55d1325f4b16f5e2 (patch)
treee1bf88131f8fe18f57a1e0ace92798828d3f4750 /network/fail2ban/rc.fail2ban
parentd8af4d8eefc2ed0063a7ff95f6a2f98d7176b88e (diff)
downloadslackbuilds-be48e858385bef134f4bcb7a55d1325f4b16f5e2.tar.gz
network/fail2ban: Updated for version 0.8.4
Diffstat (limited to 'network/fail2ban/rc.fail2ban')
-rw-r--r--network/fail2ban/rc.fail2ban26
1 files changed, 14 insertions, 12 deletions
diff --git a/network/fail2ban/rc.fail2ban b/network/fail2ban/rc.fail2ban
index bc3021e56e..86c6b7de52 100644
--- a/network/fail2ban/rc.fail2ban
+++ b/network/fail2ban/rc.fail2ban
@@ -1,20 +1,22 @@
#!/bin/sh
#
+# Copyright (c) 2008-2009, Nishant Limbachia, Hoffman Est, IL, USA (nishant@mnspace.net)
# /etc/rc.d/rc.fail2ban
#
-# start/stop/reload/status/ping fail2ban server.
+# start|stop|restart|reload|status|ping fail2ban server
#
-# To start fail2ban automatically at boot, make this
-# file executable: chmod 755 /etc/rc.d/rc.fail2ban
-# you must also add this file to rc.local in the
-# appropriate order.
+# To start fail2ban automatically at boot, make this file executable:
+# chmod 755 /etc/rc.d/rc.fail2ban
+# you must also add this file to rc.local for fail2ban to start during boot.
-SOCKET="/var/run/fail2ban/fail2ban.socket"
+### default socket file is /var/run/fail2ban/fail2ban.sock which can be
+### changed via the config file: /etc/fail2ban/fail2ban.conf
fail2ban_start() {
if [ -x /etc/rc.d/rc.fail2ban ]; then
echo "Starting fail2ban: "
- /usr/bin/fail2ban-client -x -s ${SOCKET} start
+ ### using -x option to remove any stale socket file.
+ /usr/bin/fail2ban-client -x start
else
echo "rc.fail2ban is not executable or you don't have enough permissions"
exit 1
@@ -23,22 +25,22 @@ fail2ban_start() {
fail2ban_stop() {
echo "Stopping fail2ban"
- /usr/bin/fail2ban-client -x -s ${SOCKET} stop
+ /usr/bin/fail2ban-client stop
}
fail2ban_reload() {
echo "Reloading fail2ban"
- /usr/bin/fail2ban-client -x -s ${SOCKET} reload
+ /usr/bin/fail2ban-client reload
}
fail2ban_status() {
echo "Status: fail2ban"
- /usr/bin/fail2ban-client -s ${SOCKET} status
+ /usr/bin/fail2ban-client status
}
fail2ban_ping() {
echo "Pinging fail2ban"
- /usr/bin/fail2ban-client -s ${SOCKET} ping
+ /usr/bin/fail2ban-client ping
}
case "$1" in
@@ -50,7 +52,7 @@ case "$1" in
;;
'restart')
fail2ban_stop
- sleep 2
+ sleep 5
fail2ban_start
;;
'reload')