From ac9addde30cd0d0a2d0d5157d170bd2e3f487267 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 15 Dec 2023 06:29:12 +1100 Subject: [PATCH] Fix bug where killfile never expired remove some logging --- aircon.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/aircon.sh b/aircon.sh index d642ee6..3385ffa 100755 --- a/aircon.sh +++ b/aircon.sh @@ -1745,7 +1745,7 @@ function killfile_active() { # returns true if killfile will stop us if [[ ! -f ${KILLFILE} ]]; then return 1 fi - val=$(cat "${KILLFILE}") + val=$(head -1 "${KILLFILE}") [[ -z $val ]] && return 0 now=$(date +%s) if [[ $val -le $now ]]; then @@ -2368,11 +2368,7 @@ fi # Actually run the commands if [[ $DOIT -eq 1 ]]; then - if killfile_active; then - if [[ $cronmode -eq 1 ]]; then - echo -e "${RED}Not running commands because killfile exists ($KILLFILE)${PLAIN}" - fi - else + if ! killfile_active; then run_commands [[ $cronmode -ne 1 ]] && echo