From 2194318d60e61f7e7a08086afa8b1b50bed3fa86 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 24 Nov 2016 16:50:30 +0200 Subject: [PATCH] relayevent.sh now uses a 5 seconds timeout --- motioneye/scripts/relayevent.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/motioneye/scripts/relayevent.sh b/motioneye/scripts/relayevent.sh index 962bbf8..c335870 100755 --- a/motioneye/scripts/relayevent.sh +++ b/motioneye/scripts/relayevent.sh @@ -5,6 +5,8 @@ if [ -z "$3" ]; then exit -1 fi +timeout=5 + motioneye_conf=$1 if [ -f "$motioneye_conf" ]; then port=$(cat $motioneye_conf | grep -E '^port' | cut -d ' ' -f 2) @@ -29,5 +31,5 @@ uri="/_relay_event/?_username=$username&event=$event&thread_id=$thread_id" data="{\"filename\": \"$filename\"}" signature=$(echo -n "POST:$uri:$data:$password" | sha1sum | cut -d ' ' -f 1) -curl -s -S -H "Content-Type: application/json" -X POST "http://127.0.0.1:$port$uri&_signature=$signature" -d "$data" >/dev/null +curl -s -S -m $timeout -H "Content-Type: application/json" -X POST "http://127.0.0.1:$port$uri&_signature=$signature" -d "$data" >/dev/null -- 2.39.5