add default hostname and remove quotes
This commit is contained in:
parent
e173fb53b0
commit
5776be40d7
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ remove_picture=false
|
||||||
signal_alert=false
|
signal_alert=false
|
||||||
mail_alert=false
|
mail_alert=false
|
||||||
move_to=''
|
move_to=''
|
||||||
|
motion_host="$(hostname -f)"
|
||||||
|
|
||||||
data="\"date\": \"$(date +%s)\""
|
data="\"date\": \"$(date +%s)\""
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
|
@ -229,7 +230,7 @@ if [ "${mail_alert}" == "true" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${ntfy_server}" ]; then
|
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}")"
|
ntfy_password="$(cat "${ntfy_password_file}")"
|
||||||
message "Sending event to ntfy server '${ntfy_server}/motion_detection' ..."
|
message "Sending event to ntfy server '${ntfy_server}/motion_detection' ..."
|
||||||
message "Data: ${ntfy_data}"
|
message "Data: ${ntfy_data}"
|
||||||
|
|
Loading…
Reference in a new issue