Silent pushover curl

And fixed a missing fi
This commit is contained in:
Richard Goodwin
2018-10-21 14:46:45 -05:00
parent 5cfe22fb92
commit fe764b00f7
2 changed files with 14 additions and 10 deletions

View File

@@ -43,13 +43,14 @@ function mount_mountpoint () {
log "Mounted $mount_point."
if [ -d "/mnt/cam/TeslaCam" ]
then
log "TeslaCam folder exists"
true
return
else
mkdir /mnt/cam/TeslaCam
true
return
log "TeslaCam folder exists"
true
return
else
mkdir /mnt/cam/TeslaCam
true
return
fi
else
log "Failed to mount $mount_point."
false

View File

@@ -12,10 +12,13 @@ source /root/.teslaCamPushoverCredentials
if ping -c 1 api.pushover.net &> /dev/null
then
if [ ${files_copied} -gt 0 ]
curl -F "token=$pushover_app_key" \
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