fix condition
This commit is contained in:
parent
6f9d633590
commit
b31ef80ec1
1 changed files with 3 additions and 3 deletions
|
@ -174,19 +174,19 @@ if [ -n "${file}" ]; then
|
|||
fi
|
||||
|
||||
data="{${data}}"
|
||||
if [ "${signal_alert}" ]; then
|
||||
if [ "${signal_alert}" == "true" ]; then
|
||||
message "Sending to Signal destination '${signal_destination}'..."
|
||||
/var/lib/from_repos/signal_scripts/send_msg.sh --destination "${signal_destination}" \
|
||||
--message "Clip termino en camara '${camera_name}' (${motion_host}). Evento: #${event}. File: ${file_uri}"
|
||||
fi
|
||||
|
||||
if [ "${mail_alert}" ]; then
|
||||
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}"
|
||||
fi
|
||||
|
||||
message "Sending Home Assistant event ..."
|
||||
result=$(curl -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 "${data}")
|
||||
return_code=$?
|
||||
message "Return code: ${return_code}. Result: ${result}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue