forked from ruhigundrelaxed/ioBroker.motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·34 lines (30 loc) · 1.2 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
case $1 in
"on_area_detected" )
json_answer="{\"event\": \"on_area_detected\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4}"
;;
"on_camera_lost" )
json_answer="{\"event\": \"on_camera_lost\", \"thread\": $2, \"timestamp\": \"$3\"}"
;;
"on_event_start" )
json_answer="{\"event\": \"on_event_start\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4}"
;;
"on_event_end" )
json_answer="{\"event\": \"on_event_end\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4}"
;;
"on_motion_detected" )
json_answer="{\"event\": \"on_motion_detected\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4}"
;;
"on_movie_start" )
json_answer="{\"event\": \"on_movie_start\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4, \"filename\": \"$5\"}"
;;
"on_movie_end" )
json_answer="{\"event\": \"on_movie_end\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4, \"filename\": \"$5\"}"
;;
"on_picture_save" )
json_answer="{\"event\": \"on_picture_save\", \"thread\": $2, \"timestamp\": \"$3\", \"noiselevel\": $4, \"filename\": \"$5\"}"
;;
*)
json_answer=$1
esac
echo $json_answer |netcat 127.0.0.1 6666