mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 03:35:38 +03:00
34 lines
619 B
Text
34 lines
619 B
Text
#!/sbin/openrc-run
|
|
|
|
name=nut-monitor
|
|
pidfile=/run/upsmon.pid
|
|
command=/usr/sbin/upsmon
|
|
required_files="/etc/nut/nut.conf /etc/nut/upsmon.conf"
|
|
extra_started_commands="reload"
|
|
|
|
depend() {
|
|
use net
|
|
. /etc/nut/nut.conf
|
|
case $MODE in
|
|
standalone|netserver)
|
|
need nut-upsd
|
|
;;
|
|
esac
|
|
}
|
|
|
|
start_pre() {
|
|
. /etc/nut/nut.conf
|
|
case $MODE in
|
|
none)
|
|
eerror "$name disabled, please adjust the configuration to your needs"
|
|
eerror "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $name"
|
|
start-stop-daemon --signal HUP --pidfile ${pidfile}
|
|
eend $?
|
|
}
|