updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / psad / psad-init.archlinux
blob4e80248b245ca6770e662e4a694d6d0426d658a8
1 #!/bin/sh
3 # Startup script for psad
5 # chkconfig: 345 99 05
6 # description: The Port Scan Attack Detector (psad)
7 # processname: psad
8 # pidfile: /var/run/psad.pid
9 # config: /etc/psad/psad.conf
11 # $Id: psad-init.archlinux
13 . /etc/rc.conf
14 . /etc/rc.d/functions
15 . /etc/conf.d/sshd
17 PID=`cat /var/run/psad.pid`
18 # See how we were called.
19 case "$1" in
20 start)
21 stat_busy "Starting psad"
22 [ -z "$PID" ] && /usr/sbin/psad
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 #let psad take care of the pid; we don't need to
27 add_daemon psad
28 stat_done
31 stop)
32 stat_busy "Stopping psad"
33 /usr/sbin/psad --Kill
34 if [ $? -gt 0 ]; then
35 stat_fail
36 else
37 #let psad take care of the pid; we don't need to
38 rm_daemon psad
39 stat_done
42 status)
43 /usr/sbin/psad --Status
45 restart)
46 $0 stop
47 $0 start
50 echo "Usage: psad {start|stop|status|restart}"
51 exit 1
52 esac