mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-26 20:55:19 +03:00
43 lines
907 B
Text
43 lines
907 B
Text
#!/sbin/runscript
|
|
|
|
extra_started_commands="reload"
|
|
|
|
pidfile=/var/run/upsmon.pid
|
|
upsmon=/usr/sbin/upsmon
|
|
NAME=nut-monitor
|
|
|
|
depend() {
|
|
use net
|
|
after nut-upsd
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting upsmon"
|
|
|
|
# Include NUT nut.conf
|
|
[ -r $CONFIG ] && . $CONFIG
|
|
|
|
# Explicitly require the configuration to be done in /etc/nut/nut.conf
|
|
# redundant with nut-client
|
|
if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then
|
|
eerror "$NAME disabled, please adjust the configuration to your needs"
|
|
eerror "Then set MODE to a suitable value in $CONFIG to enable it"
|
|
# exit success to avoid breaking the install process!
|
|
return 1
|
|
fi
|
|
|
|
start-stop-daemon --start --pidfile ${pidfile} --exec ${upsmon} -- ${ARGS}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping upsmon"
|
|
start-stop-daemon --stop --pidfile ${pidfile}
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading upsmon"
|
|
start-stop-daemon --stop --signal HUP --pidfile ${pidfile}
|
|
eend $?
|
|
}
|