]> www.vanbest.org Git - motioneye-debian/commitdiff
relayevent.sh now uses a 5 seconds timeout
authorCalin Crisan <ccrisan@gmail.com>
Thu, 24 Nov 2016 14:50:30 +0000 (16:50 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Thu, 24 Nov 2016 14:50:30 +0000 (16:50 +0200)
motioneye/scripts/relayevent.sh

index 962bbf81916404970b81da38e18057c681c8a9ad..c335870e63b6a8c77241ec05a06482aef9a9ac88 100755 (executable)
@@ -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