aports/testing/nut/upsmon.initd
Valery Kartel e409857fde testing/nut: Upgrade to 2.7.4. conf.d & init.d cleanups
- rename all /etc/nut/*.conf.sample to /etc/nut/*.conf
- make conf.d/* init.d/* more clean and openrc-run'ed
- nut-upsmon now dynamically depends on nut-upsd if the MODE parameter in /etc/nut/nut.conf is set to 'standalone' or 'netserver'.
- make a user and group creation in pre-install. I think we need to remove this user/group from alpine-baselayout.
2016-07-07 11:38:04 +02:00

35 lines
623 B
Plaintext

#!/sbin/openrc-run
name=nut-monitor
pidfile=/var/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 $?
}