fix ntfy data
This commit is contained in:
parent
a025ccd77e
commit
efeddbb6be
1 changed files with 3 additions and 3 deletions
|
@ -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}'"
|
||||
|
|
Loading…
Reference in a new issue