Update power.inc.sh
This commit is contained in:
@@ -386,7 +386,7 @@ BATT VOLTAGE: ${BATTVOLT}'volts"
|
|||||||
fi
|
fi
|
||||||
echo 1a
|
echo 1a
|
||||||
if [ ! -f ${PW_TMPFOLDER}/power.ac.good ]; then
|
if [ ! -f ${PW_TMPFOLDER}/power.ac.good ]; then
|
||||||
|
echo 1a-1
|
||||||
if [ -f ${PW_TMPFOLDER}/shutdown.SYS ] || [ -f ${PW_TMPFOLDER}/shutdown.MAIN ] || [ -f ${PW_TMPFOLDER}/power.ac.conserve ]; then
|
if [ -f ${PW_TMPFOLDER}/shutdown.SYS ] || [ -f ${PW_TMPFOLDER}/shutdown.MAIN ] || [ -f ${PW_TMPFOLDER}/power.ac.conserve ]; then
|
||||||
SENDNOTICE "HOSTS POWER" "Power restored! Will wait ${PW_WAIT_TO_POWER_SERVERS}'mins before turning host(s) back on"
|
SENDNOTICE "HOSTS POWER" "Power restored! Will wait ${PW_WAIT_TO_POWER_SERVERS}'mins before turning host(s) back on"
|
||||||
touch ${PW_TMPFOLDER}/.power.restored
|
touch ${PW_TMPFOLDER}/.power.restored
|
||||||
@@ -396,6 +396,7 @@ BATT VOLTAGE: ${BATTVOLT}'volts"
|
|||||||
touch ${PW_TMPFOLDER}/power.ac.good
|
touch ${PW_TMPFOLDER}/power.ac.good
|
||||||
|
|
||||||
elif [ -f ${PW_TMPFOLDER}/.power.restored ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.power.restored)) -ge $(echo "scale=0; ${PW_WAIT_TO_POWER_SERVERS}*60" | bc) ]; then
|
elif [ -f ${PW_TMPFOLDER}/.power.restored ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.power.restored)) -ge $(echo "scale=0; ${PW_WAIT_TO_POWER_SERVERS}*60" | bc) ]; then
|
||||||
|
echo 1a-2
|
||||||
HOSTMGMT mainsite -p on >/dev/null 2>&1
|
HOSTMGMT mainsite -p on >/dev/null 2>&1
|
||||||
rm -f ${PW_TMPFOLDER}/.power.restored
|
rm -f ${PW_TMPFOLDER}/.power.restored
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user