From: Zoltán Felleg Date: Fri, 19 Feb 2021 20:29:35 +0000 (+0100) Subject: Updated vhost{1, 2}.usr (minor tweaks in temperature.sh). X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=152bdc12f4fecf3237a0a1e94638e2367a16b92f;p=user-lxc.git Updated vhost{1, 2}.usr (minor tweaks in temperature.sh). --- diff --git a/sources/vhost1.usr/root/temperature.sh b/sources/vhost1.usr/root/temperature.sh index 4480398..6608eab 100755 --- a/sources/vhost1.usr/root/temperature.sh +++ b/sources/vhost1.usr/root/temperature.sh @@ -177,11 +177,11 @@ send_heartbeat_sms() { if [ -f $SCRIPT_STOP ] then - STOP_STATUS="on" + SEND_STATUS="does NOT" else - STOP_STATUS="off" + SEND_STATUS="DOES" fi - MESSAGE="Heartbeat ${MESSAGE_TYPE}: temperature is ${TEMPERATURE}, stop status: $STOP_STATUS" + MESSAGE="Heartbeat ${MESSAGE_TYPE}: temperature is ${TEMPERATURE}, the system $SEND_STATUS send SMSs." SMS_TARGETS="" i=0 while [ $i -lt $NUMBER_OF_HEARTBEAT_PHONES ] @@ -274,12 +274,6 @@ fi log_temperature $MESSAGE_TYPE $TEMPERATURE -DAY_HOUR_MINUTE=$(date "+%u%H%M") -if [ "$DAY_HOUR_MINUTE" == "11000" ] -then - send_heartbeat_sms $MESSAGE_TYPE $TEMPERATURE -fi - if [ -f $SCRIPT_STOP ] then CURRENT_TS=$(date +%s) @@ -291,6 +285,12 @@ then fi fi +DAY_HOUR_MINUTE=$(date "+%u%H%M") +if [ "$DAY_HOUR_MINUTE" == "11000" ] +then + send_heartbeat_sms $MESSAGE_TYPE $TEMPERATURE +fi + if [ -f $SCRIPT_STOP ] then exit 0 diff --git a/sources/vhost2.usr/root/temperature.sh b/sources/vhost2.usr/root/temperature.sh index 4480398..6608eab 100755 --- a/sources/vhost2.usr/root/temperature.sh +++ b/sources/vhost2.usr/root/temperature.sh @@ -177,11 +177,11 @@ send_heartbeat_sms() { if [ -f $SCRIPT_STOP ] then - STOP_STATUS="on" + SEND_STATUS="does NOT" else - STOP_STATUS="off" + SEND_STATUS="DOES" fi - MESSAGE="Heartbeat ${MESSAGE_TYPE}: temperature is ${TEMPERATURE}, stop status: $STOP_STATUS" + MESSAGE="Heartbeat ${MESSAGE_TYPE}: temperature is ${TEMPERATURE}, the system $SEND_STATUS send SMSs." SMS_TARGETS="" i=0 while [ $i -lt $NUMBER_OF_HEARTBEAT_PHONES ] @@ -274,12 +274,6 @@ fi log_temperature $MESSAGE_TYPE $TEMPERATURE -DAY_HOUR_MINUTE=$(date "+%u%H%M") -if [ "$DAY_HOUR_MINUTE" == "11000" ] -then - send_heartbeat_sms $MESSAGE_TYPE $TEMPERATURE -fi - if [ -f $SCRIPT_STOP ] then CURRENT_TS=$(date +%s) @@ -291,6 +285,12 @@ then fi fi +DAY_HOUR_MINUTE=$(date "+%u%H%M") +if [ "$DAY_HOUR_MINUTE" == "11000" ] +then + send_heartbeat_sms $MESSAGE_TYPE $TEMPERATURE +fi + if [ -f $SCRIPT_STOP ] then exit 0