Skip to content

Commit cc257f2

Browse files
authored
Update unifi-video-mqtt.sh
Fixes mzac#2 mzac#5 mzac#6 based on your Dockerfile, `grep -n1` isn't supported so I removed the -n1. I commented out all the variables at the top so they can be passed in with docker env vars instead.
1 parent 5bbcc01 commit cc257f2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

unifi-video-mqtt.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
UNIFI_MOTION_LOG=/var/log/unifi-video/motion.log
55

66
# MQTT Vars
7-
MQTT_SERVER="192.168.x.x"
8-
MQTT_PORT="1883"
9-
MQTT_TOPIC_BASE="camera/motion"
7+
#MQTT_SERVER="192.168.x.x"
8+
#MQTT_PORT="1883"
9+
#MQTT_TOPIC_BASE="camera/motion"
1010

1111
# MQTT User/Pass Vars, only use if needed
1212
#MQTT_USER="username"
1313
#MQTT_PASS="password"
1414
#MQTT_ID="yourid" ## To make it work with hassio
1515

1616
# Camera Defs
17-
CAM1_NAME="camera_name"
18-
CAM1_ID="F0xxxxxxxxxx"
17+
#CAM1_NAME="camera_name"
18+
#CAM1_ID="F0xxxxxxxxxx"
1919

2020
# --------------------------------------------------------------------------------
2121
# Script starts here
@@ -50,7 +50,7 @@ while inotifywait -e modify $UNIFI_MOTION_LOG; do
5050

5151
LAST_EVENT=`echo $LAST_MESSAGE | cut -d ':' -f 5 | cut -d ' ' -f 1`
5252

53-
if echo $LAST_CAM | grep -n1 $CAM1_ID; then
53+
if echo $LAST_CAM | grep $CAM1_ID; then
5454
# Camera 1 triggered
5555
if [[ $LAST_EVENT == "start" ]]; then
5656
echo "Motion started on $CAM1_NAME"

0 commit comments

Comments
 (0)