summaryrefslogtreecommitdiff
path: root/network/fail2ban/rc.fail2ban
diff options
context:
space:
mode:
authorNishant Limbachia <nishant@mnspace.net>2010-05-11 22:25:16 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-11 22:25:16 +0200
commit8876733ea6f004244472cff76bd964dc8cc5aedf (patch)
tree974ecdb9203d9b2ed68d86bd11bd927946cb7deb /network/fail2ban/rc.fail2ban
parent5af4f2b0615f5e0d18ce4fd4411cf082878d6de4 (diff)
downloadslackbuilds-8876733ea6f004244472cff76bd964dc8cc5aedf.tar.gz
network/fail2ban: Updated for version 0.8.3
Diffstat (limited to 'network/fail2ban/rc.fail2ban')
-rw-r--r--network/fail2ban/rc.fail2ban45
1 files changed, 25 insertions, 20 deletions
diff --git a/network/fail2ban/rc.fail2ban b/network/fail2ban/rc.fail2ban
index 5f34cdb1ef..681e86bcad 100644
--- a/network/fail2ban/rc.fail2ban
+++ b/network/fail2ban/rc.fail2ban
@@ -9,56 +9,61 @@
# you must also add this file to rc.local in the appropriate
# order
#
+SOCKET="/var/run/fail2ban/fail2ban.socket"
fail2ban_start() {
if [ -x /etc/rc.d/rc.fail2ban ]; then
- echo "Starting fail2ban: "
- /usr/bin/fail2ban-client start
+ echo "Starting fail2ban: "
+ /usr/bin/fail2ban-client -x -s ${SOCKET} start
else
- echo "rc.fail2ban is not executable or you don't have enough permissions"
- exit 1
+ echo "rc.fail2ban is not executable or you don't have enough permissions"
+ exit 1
fi
}
fail2ban_stop() {
- echo "Stopping fail2ban"
- /usr/bin/fail2ban-client stop
+ echo "Stopping fail2ban"
+ /usr/bin/fail2ban-client -x -s ${SOCKET} stop
}
fail2ban_reload() {
- echo "Reloading fail2ban"
- /usr/bin/fail2ban-client reload
+ echo "Reloading fail2ban"
+ /usr/bin/fail2ban-client -x -s ${SOCKET} reload
}
fail2ban_status() {
- echo "Status: fail2ban"
- /usr/bin/fail2ban-client status
+ echo "Status: fail2ban"
+ /usr/bin/fail2ban-client -s ${SOCKET} status
}
fail2ban_ping() {
- echo "Pinging fail2ban"
- /usr/bin/fail2ban-client ping
+ echo "Pinging fail2ban"
+ /usr/bin/fail2ban-client -s ${SOCKET} ping
}
case "$1" in
'start')
- fail2ban_start
+ fail2ban_start
;;
'stop')
- fail2ban_stop
+ fail2ban_stop
;;
+'restart')
+ fail2ban_stop
+ sleep 2
+ fail2ban_start
+;;
'reload')
- fail2ban_reload
+ fail2ban_reload
;;
'status')
- fail2ban_status
+ fail2ban_status
;;
'ping')
- fail2ban_ping
+ fail2ban_ping
;;
'*')
- echo "USAGE: $0 start|stop|reload|status|ping"
- exit 1
+ echo "USAGE: $0 start|stop|restart|reload|status|ping"
+ exit 1
;;
esac
-