On Sat, 25 May 2019, Mike Dillinger wrote:

How about something like this:

      case $OPTION in
          lowbatt)
                MSG="NUT upssched \"lowbatt\" confirmation begins. Waiting for 5 
seconds"
                echo "$SCRIPT: $MSG"
                logger -t $SCRIPT "$MSG"
                Wait for 5 seconds
                CHARGE=$( upsc <myups> battery.charge )
                if CHARGE ok then exit from script
              MSG="NUT upssched \"lowbatt\" sequence start: UPS Low Battery; Begin 
shutting down clients"
              echo "$SCRIPT: $MSG"
              logger -t $SCRIPT "$MSG"
              /etc/nut/scripts/shutdown-control &
              MSG="NUT upssched \"lowbatt\" sequence initiated"
              echo "$SCRIPT: $MSG"
              logger -t $SCRIPT "$MSG"
              ;;
        ...
      esac
      exit 0
_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to