#!/bin/sh # check for APC UPS with delayed shutdown # return 0 if no delay and delay time if exist UPSLIST="SMART-UPS" RET=`/usr/sbin/apcaccess|egrep -e "$UPSLIST"|wc -l` [ $RET -ne 0 ] || exit 0 MIN=`/usr/sbin/apcaccess|grep DSHUTD|sed -e "s/.*: \([0-9]*\) .*/\1/"` exit $MIN