From 152bdc12f4fecf3237a0a1e94638e2367a16b92f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Fri, 19 Feb 2021 21:29:35 +0100 Subject: [PATCH] Updated vhost{1, 2}.usr (minor tweaks in temperature.sh). --- sources/vhost1.usr/root/temperature.sh | 18 +++++++++--------- sources/vhost2.usr/root/temperature.sh | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) 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 -- 2.54.0