#!/bin/sh # Test for the shutdown flag if @SBINDIR@/upsmon -K >/dev/null 2>&1; then # Check if a power race workaround has been configured wait_delay=`/bin/sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' @CONFPATH@/nut.conf` # Command the UPS driver(s) to run their shutdown sequence @SBINDIR@/upsdrvctl shutdown if [ -n "$wait_delay" ] ; then /bin/sleep $wait_delay # We need to pass --force twice here to bypass systemd and execute the # reboot directly ourself. /bin/systemctl reboot --force --force fi fi exit 0