fix ntfy data

This commit is contained in:
Antonio J. Delgado 2023-03-20 22:51:02 +02:00
parent a025ccd77e
commit efeddbb6be

View file

@ -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}'"