3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
8 /etc/init.d/nut-server stop "$1"
13 config_get driver "$cfg" driver "usbhid-ups"
15 # Only FSD if killpower was indicated
16 if [ -f /var/run/killpower ]; then
17 /lib/nut/"${driver}" -a "$cfg" -k
22 if [ -f /var/run/killpower ]; then
23 # Only make FS readonly if we are doing an FSD
24 mount -o remount,ro /overlay /overlay
25 mount -o remount,ro / /
27 . ${IPKG_INSTOOT}/lib/functions.sh
29 if [ -f /etc/config/nut_server ]; then
30 config_load nut_server
32 # Can't FSD unless drivers are stopped
33 config_foreach stop_instance driver
34 # Driver will wait 'offdelay' before shutting down
35 config_foreach shutdown_instance driver
37 rm -f /var/run/killpower
41 # Uh-oh failed to poweroff UPS