summaryrefslogtreecommitdiff
path: root/community/sshguard/sshguard.rc
diff options
context:
space:
mode:
Diffstat (limited to 'community/sshguard/sshguard.rc')
-rwxr-xr-xcommunity/sshguard/sshguard.rc26
1 files changed, 26 insertions, 0 deletions
diff --git a/community/sshguard/sshguard.rc b/community/sshguard/sshguard.rc
new file mode 100755
index 000000000..4b8dee06f
--- /dev/null
+++ b/community/sshguard/sshguard.rc
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting SSHGuard"
+ tail -n0 -F /var/log/auth.log | /usr/sbin/sshguard -b /var/db/sshguard/blacklist.db &> /dev/null &
+ add_daemon sshguard
+ stat_done
+ ;;
+ stop)
+ stat_busy "Stopping SSHGuard"
+ kill `pidof sshguard` &> /dev/null
+ rm_daemon sshguard
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0