From efeddbb6beef3850cd71c838515dc84e71e79202 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 20 Mar 2023 22:51:02 +0200 Subject: [PATCH] fix ntfy data --- files/process_motion_event.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/process_motion_event.sh b/files/process_motion_event.sh index 5cce59d..9949efe 100644 --- a/files/process_motion_event.sh +++ b/files/process_motion_event.sh @@ -207,7 +207,7 @@ if [ -n "${file}" ]; then fi fi -data="{${data}}" +json_data="{${data}}" if [ "${signal_alert}" == "true" ]; then message "Sending to Signal destination '${signal_destination}'..." /var/lib/from_repos/signal_scripts/send_msg.sh --destination "${signal_destination}" \ @@ -221,7 +221,7 @@ fi if [ "${mail_alert}" == "true" ]; then message "Sending email to '${email_destination}'..." - echo "${data}" | jq '.' | mail -s "Motion event '${event_type}' on host '${motion_host}' camera '${camera_name}'" "${email_destination}" + echo "${json_data}" | jq '.' | mail -s "Motion event '${event_type}' on host '${motion_host}' camera '${camera_name}'" "${email_destination}" return_code=$? if [ $return_code != 0 ]; then message "Error ${return_code} sending email" @@ -242,7 +242,7 @@ fi if [ -n "${ha_url}" ]; then message "Sending event to Home Assistant ..." - result=$(curl -s -X POST -H "Authorization: Bearer ${ha_token}" -H "Content-Type: application/json" "${ha_url}/api/events/motion_event" -d "${data}") + result=$(curl -s -X POST -H "Authorization: Bearer ${ha_token}" -H "Content-Type: application/json" "${ha_url}/api/events/motion_event" -d "${json_data}") return_code=$? if [ $return_code != 0 ]; then message "Error ${return_code} sending to Home Assistant '${ha_url}'"