From e15506681d1233eab9a7e445622eaf124de54c0b Mon Sep 17 00:00:00 2001 From: Richard Goodwin Date: Fri, 26 Oct 2018 09:06:37 -0500 Subject: [PATCH] Extra checks for whether to send push --- run/cifs_archive/archive-clips.sh | 3 +++ run/send-pushover | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/run/cifs_archive/archive-clips.sh b/run/cifs_archive/archive-clips.sh index c7523a5..2816065 100644 --- a/run/cifs_archive/archive-clips.sh +++ b/run/cifs_archive/archive-clips.sh @@ -19,6 +19,9 @@ for file_name in "$CAM_MOUNT"/TeslaCam/saved*; do done log "Moved $NUM_FILES_MOVED file(s)." +if [ $NUM_FILES_MOVED -gt 0 ] +then /root/bin/send-pushover "$NUM_FILES_MOVED" +fi log "Finished moving clips to archive." diff --git a/run/send-pushover b/run/send-pushover index 9d5ffa5..7fc5402 100644 --- a/run/send-pushover +++ b/run/send-pushover @@ -7,7 +7,7 @@ function log () { echo "$1" >> "$LOG_FILE" } -if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $NUM_FILES_MOVED > 0 ] +if [ -r "/root/.teslaCamPushoverCredentials" ] && [ $NUM_FILES_MOVED -gt 0 ] then log "Sending Pushover message for moved files."