publish images to mqtt broker

This commit is contained in:
Arne Baeumler 2017-05-01 21:51:46 +02:00
commit b3466f583f

19
scripts/mqtt Normal file
View 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" \