4f122cec7d3eb36dc665ea45ea7559deeff2b2ca
[gentoo.git] / sys-power / nut / files / nut-2.2.2-init.d-upsmon
1 #!/sbin/runscript
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Id$
5
6 extra_started_commands="reload"
7
8 pidfile=/var/run/upsmon.pid
9 bin=/usr/sbin/upsmon
10
11 depend() {
12         need net
13 }
14
15 start() {
16         ebegin "Starting upsmon"
17         start-stop-daemon --start --quiet --exec ${bin}
18         eend $?
19 }
20
21 stop() {
22         ebegin "Stopping upsmon"
23         start-stop-daemon --stop --quiet --pidfile ${pidfile}
24         eend $?
25 }
26 reload() {
27         ebegin "Reloading upsd"
28         start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile}
29         eend $?
30 }