updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / nhsups / nhsupsserver
blobd721c4e5333d74ee5c7e0c9d0dcb9c0eff9348a2
1 #!/bin/sh -e
3 ### BEGIN INIT INFO
4 # Provides: nhsupsserver
5 # Required-Start: $local_fs $remote_fs $network
6 # Required-Stop: $local_fs $remote_fs $network
7 # Default-Start: 2 3 4 5
8 # Default-Stop: 0 1 6
9 # Short-Description: NHS UPS Server
10 ### END INIT INFO
12 NHSUPSSERVER=/usr/local/nhs/nhsupsserver
13 PIDFILE=/var/lib/nhsups/nhsupsserver.pid
15 . /etc/rc.conf
16 . /etc/rc.d/functions
18 do_start()
20 stat_busy "Starting NHS UPS Server Daemon"
21 $NHSUPSSERVER -d
22 add_daemon nhsupsServer
23 stat_done
26 do_stop()
28 if [ -e $PIDFILE ]; then
29 stat_busy "Stopping NHS UPS Server Daemon"
30 rm_daemon nhsupsServer
31 kill $(cat $PIDFILE) || rm $PIDFILE
32 stat_done
36 case "$1" in
37 start)
38 do_start
40 stop)
41 do_stop
43 restart | reload | force-reload)
44 do_stop
45 sleep 2
46 do_start
48 status)
49 if [ -e $PIDFILE ]; then
50 echo "Serviço iniciado.";
51 else
52 echo "Serviço parado.";
56 echo "Uso: $0 {start|stop|restart|reload|force-reload|status}"
57 exit 1
59 esac
61 exit 0