diff options
author | Nishant Limbachia <nishant@mnspace.net> | 2010-05-11 20:01:32 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-11 20:01:32 +0200 |
commit | ef122d70daa1afcf6922316369514afd3e7d094a (patch) | |
tree | 75563b57a0f40c00108a23c9731a1f2b4ebce681 /network/fail2ban/rc.fail2ban | |
parent | 4476709274ae0b8a97d086b75673707639dc8b61 (diff) | |
download | slackbuilds-ef122d70daa1afcf6922316369514afd3e7d094a.tar.gz |
network/fail2ban: Added to 12.0 repository
Diffstat (limited to 'network/fail2ban/rc.fail2ban')
-rw-r--r-- | network/fail2ban/rc.fail2ban | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/network/fail2ban/rc.fail2ban b/network/fail2ban/rc.fail2ban new file mode 100644 index 0000000000..5f34cdb1ef --- /dev/null +++ b/network/fail2ban/rc.fail2ban @@ -0,0 +1,64 @@ +#!/bin/sh +# +# /etc/rc.d/rc.fail2ban +# +# start/stop/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 +# + +fail2ban_start() { + if [ -x /etc/rc.d/rc.fail2ban ]; then + echo "Starting fail2ban: " + /usr/bin/fail2ban-client start + else + 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 +} + +fail2ban_reload() { + echo "Reloading fail2ban" + /usr/bin/fail2ban-client reload +} + +fail2ban_status() { + echo "Status: fail2ban" + /usr/bin/fail2ban-client status +} + +fail2ban_ping() { + echo "Pinging fail2ban" + /usr/bin/fail2ban-client ping +} + +case "$1" in +'start') + fail2ban_start + ;; +'stop') + fail2ban_stop + ;; +'reload') + fail2ban_reload + ;; +'status') + fail2ban_status + ;; +'ping') + fail2ban_ping + ;; +'*') + echo "USAGE: $0 start|stop|reload|status|ping" + exit 1 + ;; +esac + |