case $1 in ONLINE) MSG="UPS on line power" upscmd -u Username -p Password upsname@localhost shutdown.stop ;; ONBATT) MSG="UPS on battery" ;; LOWBATT) MSG="UPS battery is low" ;; FSD) MSG="UPS forced shutdown in progress" /usr/local/sbin/upsmon -c fsd ;; COMMOK) MSG="Communications with UPS established" ;; COMMBAD) MSG="Communications with UPS lost" ;; SHUTDOWN) MSG="Auto logout and shutdown proceeding" upscmd -u User -p pass upsname@localhost shutdown.return ;; REPLBATT) MSG="UPS battery needs to be replaced" ;; NOCOMM) MSG="UPS is unavailable" ;; NOPARENT) MSG="upsmon parent process died - shutdown impossible" ;; *) MSG="Unrecognized command: $1" ;; esac /usr/local/bin/growlnotify -s -n "UPSNAME" -m "$MSG" -P "PA$$W0RD"