publish images to mqtt broker
This commit is contained in:
commit
b3466f583f
19
scripts/mqtt
Normal file
19
scripts/mqtt
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
BROKER=broker.example.com
|
||||
BASETOPIC=camera
|
||||
USERNAME=mqtt-user
|
||||
PASSWORD=mqtt-passwordsten.de
|
||||
|
||||
CAMERA=$1
|
||||
IMAGE=$2
|
||||
|
||||
[ "x$CAMERA" == "x" ] && echo "Usage: $0 <CAMERA> <IMAGE>" && exit 1
|
||||
[ "x$IMAGE" == "x" ] && "Usage: $0 <CAMERA> <IMAGE>" && exit 2
|
||||
|
||||
/usr/bin/mosquitto_pub \
|
||||
-h "$BROKER" \
|
||||
-u "$USERNAME" \
|
||||
-P "$PASSWORD" \
|
||||
-t "$BASETOPIC/$CAMERA" \
|
||||
-f "$IMAGE" \
|
Loading…
x
Reference in New Issue
Block a user