Add wrappers that check the MODE in /etc/nut/nut.conf to avoid starting the daemons if nut is not configured (Closes: #747863).

This commit is contained in:
Laurent Bigonville 2015-01-25 12:54:03 +01:00
parent fedf671e4d
commit 241119d464
6 changed files with 49 additions and 1 deletions

19
debian/local/upsd vendored Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
# Include NUT nut.conf
[ -r /etc/nut/nut.conf ] && . /etc/nut/nut.conf
case "$MODE" in
standalone|netserver)
exec /lib/nut/upsd "$@"
;;
none|netclient)
echo "upsd disabled, please adjust the configuration to your needs"
echo "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
# exit success to avoid breaking the install process!
exit 0
;;
*)
exit 1
;;
esac

19
debian/local/upsmon vendored Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
# Include NUT nut.conf
[ -r /etc/nut/nut.conf ] && . /etc/nut/nut.conf
case "$MODE" in
standalone|netserver|netclient)
exec /lib/nut/upsmon "$@"
;;
none)
echo "upsmon disabled, please adjust the configuration to your needs"
echo "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
# exit success to avoid breaking the install process!
exit 0
;;
*)
exit 1
;;
esac