updated on Sun Jan 15 20:01:04 UTC 2012
[aur-mirror.git] / dionaea-git / dionaea.rc
blobaf28456b052a22f6160f2450d3e0ac74f909753d
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 [ -f /etc/conf.d/dionaea ] && . /etc/conf.d/dionaea
6 PID="$(cat /var/run/dionaea.pid 2>/dev/null)"
7 # Check if process is still running
8 kill -0 ${PID} 2>/dev/null
9 if [ $? -gt 0 ]; then
10 PID=""
13 start() {
14 stat_busy "Starting Dionaea"
15 [ -z "$PID" ] && /opt/dionaea/bin/dionaea ${DIONAEA_OPTS} -l ${LOG_LEVEL_OPTS} -L ${LOG_DOMAIN_OPTS} -D -p /var/run/dionaea.pid &>/dev/null &
16 if [ $? -gt 0 ]; then
17 stat_fail
18 else
19 add_daemon dionaea
20 stat_done
23 stop() {
24 stat_busy "Stopping Dionaea"
25 [ ! -z "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon dionaea
30 stat_done
34 case "$1" in
35 start)
36 start
38 stop)
39 stop
41 restart)
42 $0 stop
43 sleep 1
44 $0 start
47 echo "usage: $0 {start|stop|restart}"
48 esac
49 exit 0