updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / amora-server / amorad
blobf5bf6233351c0eb07ad4bbe10fd865e6a49a5e95
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PARAMS=
7 [ -f /etc/conf.d/amora ] && . /etc/conf.d/amora
8 PID=$(pidof -o %PPID /usr/bin/amorad)
9 case "$1" in
10 start)
11 stat_busy "Starting Amora server"
12 [ -z "$PID" ] && /usr/bin/amorad $PARAMS 2>&1 &
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon amorad
17 stat_done
20 stop)
21 stat_busy "Stoping Amora server"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon amorad
27 stat_done
28 fi
30 restart)
31 $0 stop
32 sleep 2
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0