Files
teslausb/windows_archive/send-pushover
Richard Goodwin fe764b00f7 Silent pushover curl
And fixed a missing fi
2018-10-21 14:46:45 -05:00

25 lines
524 B
Bash

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