mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-19 01:05:15 +03:00
-- add nut home dir /var/lib/nut used for scheduler fix libexec and driver dirs (libexec -> lib) add using dns in init-scripts remove conf.d files from package because it have no sence for now cleanups in APKBUILD and init-scripts
40 lines
778 B
Text
40 lines
778 B
Text
#!/sbin/openrc-run
|
|
|
|
name="UPS Server"
|
|
pidfile=/run/nut/upsd.pid
|
|
command=/usr/sbin/upsd
|
|
required_files="/etc/nut/nut.conf /etc/nut/upsd.conf"
|
|
extra_started_commands="reload"
|
|
start_stop_daemon_args="--quiet"
|
|
|
|
depend() {
|
|
use net dns
|
|
}
|
|
|
|
start_pre() {
|
|
. /etc/nut/nut.conf
|
|
case $MODE in
|
|
standalone|netserver)
|
|
checkpath -d --owner nut:nut --mode 750 ${pidfile%/*} || return 1
|
|
/usr/sbin/upsdrvctl start > /dev/null
|
|
;;
|
|
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
|
|
;;
|
|
*)
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
stop_post() {
|
|
/usr/sbin/upsdrvctl stop > /dev/null
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $name"
|
|
start-stop-daemon --signal HUP --pidfile $pidfile
|
|
eend $?
|
|
}
|