From 5776be40d7b10013a857a3e85829d4c8b935f618 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 20 Mar 2023 22:54:35 +0200 Subject: [PATCH] add default hostname and remove quotes --- files/process_motion_event.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/process_motion_event.sh b/files/process_motion_event.sh index bfe01f9..6bedb2c 100644 --- a/files/process_motion_event.sh +++ b/files/process_motion_event.sh @@ -7,6 +7,7 @@ remove_picture=false signal_alert=false mail_alert=false move_to='' +motion_host="$(hostname -f)" data="\"date\": \"$(date +%s)\"" while [ $# -gt 0 ] @@ -229,7 +230,7 @@ if [ "${mail_alert}" == "true" ]; then fi if [ -n "${ntfy_server}" ]; then - ntfy_data="{ \"topic\": \"motion_detection\", \"message\": \"Motion event '${event_type}' on host '${motion_host}' camera '${camera_name}'\", \"email\": \"${email_destination}\" }" + ntfy_data="{ \"topic\": \"motion_detection\", \"message\": \"Event ${event_type} on host ${motion_host} camera ${camera_name}\", \"email\": \"${email_destination}\" }" ntfy_password="$(cat "${ntfy_password_file}")" message "Sending event to ntfy server '${ntfy_server}/motion_detection' ..." message "Data: ${ntfy_data}"