commit b3466f583fd86234cf8da32e177205a24d2bb376 Author: Arne Baeumler Date: Mon May 1 21:51:46 2017 +0200 publish images to mqtt broker diff --git a/scripts/mqtt b/scripts/mqtt new file mode 100644 index 0000000..c917afb --- /dev/null +++ b/scripts/mqtt @@ -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 " && exit 1 +[ "x$IMAGE" == "x" ] && "Usage: $0 " && exit 2 + +/usr/bin/mosquitto_pub \ + -h "$BROKER" \ + -u "$USERNAME" \ + -P "$PASSWORD" \ + -t "$BASETOPIC/$CAMERA" \ + -f "$IMAGE" \