updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / cloudkick-agent / cloudkick-agentd
blobb96114699e92f4185a0be7b4bc8f2aa24f21cff3
1 #! /bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PIDFILE=/var/run/cloudkick-agent.pid
8 PID=`cat PIDFILE 2>/dev/null`
10 case "$1" in
11 start)
12 stat_busy "Starting cloudkick-agent"
13 [ -z "$PID" ] && /usr/sbin/cloudkick-agent --daemon -c /etc/cloudkick.conf -p $PIDFILE & &> /dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon cloudkick-agent
18 stat_done
21 stop)
22 stat_busy "Stopping cloudkick-agent"
23 [ ! -z "$PID" ] && kill $PID &> /dev/null
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 rm -f $PIDFILE
28 rm_daemon cloudkick-agent
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac
40 exit 0