updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nhsups / nhsupsclient
blobeb83985d0580ef7fa3df48baab66a7f3e562617a
1 #!/bin/sh -e
3 ### BEGIN INIT INFO
4 # Provides: nhsupsclient
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 Client
10 ### END INIT INFO
12 NHSUPSCLIENT=/usr/local/nhs/nhsupsclient
13 PIDFILE=/var/lib/nhsups/nhsupsclient.pid
15 . /etc/rc.conf
16 . /etc/rc.d/functions
18 do_start()
20 stat_busy "Starting NHS UPS Client Daemon"
21 $NHSUPSCLIENT -d
22 add_daemon nhsups
23 stat_done
26 do_stop()
28 if [ -e $PIDFILE ]; then
29 stat_busy "Stopping NHS UPS Client Daemon"
30 rm_daemon nhsups
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