Better testing of pushover

And archive loop logging weirdness.
This commit is contained in:
Richard Goodwin
2018-10-21 13:37:29 -05:00
parent a8ac613fd0
commit 5b4dd4538f
3 changed files with 12 additions and 9 deletions

View File

@@ -1,18 +1,21 @@
#!/bin/bash -eu
LOGFILE=/tmp/archiveloop.log
files_copied=$1
LOG_FILE=/tmp/archiveloop.log
function log () {
echo "$( date ) : $1" >> "$LOGFILE"
echo "$( date ) : $1" >> "$LOG_FILE"
}
source /root/.teslaCamPushoverCredentials
if ping -c 1 api.pushover.net &> /dev/null
then
if [ ${files_copied} -gt 0 ]
curl -F "token=$pushover_app_key" \
-F "user=$pushover_user_key" \
-F "title=Dashcam Copy Complete" \
-F "message=$1 file(s) were copied." \
-F "message=${files_copied} file(s) were copied." \
https://api.pushover.net/1/messages
fi