X-Git-Url: http://git.rot13.org/?p=mqtt-homehub;a=blobdiff_plain;f=sonoff.sh;fp=sonoff.sh;h=c73d4f61419d91d2725807ada20de4cd33c1a6df;hp=0000000000000000000000000000000000000000;hb=382579fd785b57456c76fe2141f9722e1ba34f34;hpb=575774bb6b3be2bb3a611a322819a914f06cfcc1 diff --git a/sonoff.sh b/sonoff.sh new file mode 100755 index 0000000..c73d4f6 --- /dev/null +++ b/sonoff.sh @@ -0,0 +1,5 @@ +#!/bin/sh -xe +test -z "$1" && echo "usage: $0 light|ledstate on|off" && exit 1 +device=`basename $0 | cut -d. -f1` +mosquitto_pub -h rpi2 -t "cmnd/$device/$1" -m "$2" +