ma bureautomation: use mqtt instead of curl
seems they've change something in their security security
This commit is contained in:
parent
742c041b72
commit
0c25e97905
|
@ -5,7 +5,7 @@ let
|
||||||
port = 3001;
|
port = 3001;
|
||||||
runit = pkgs.writeDash "runit" ''
|
runit = pkgs.writeDash "runit" ''
|
||||||
set -xeuf
|
set -xeuf
|
||||||
PATH=${pkgs.curl}/bin:${pkgs.coreutils}/bin
|
PATH=${pkgs.mosquitto}/bin:${pkgs.coreutils}/bin
|
||||||
name=''${1?must provide name as first arg}
|
name=''${1?must provide name as first arg}
|
||||||
state=''${2?must provide state as second arg}
|
state=''${2?must provide state as second arg}
|
||||||
# val=''${3?must provide val as third arg}
|
# val=''${3?must provide val as third arg}
|
||||||
|
@ -14,9 +14,10 @@ let
|
||||||
test $state = alerting || exit 0
|
test $state = alerting || exit 0
|
||||||
|
|
||||||
echo $name - $state
|
echo $name - $state
|
||||||
curl 'http://bauarbeiterlampe/ay?o=1'
|
topic=plug
|
||||||
|
mosquitto_pub -t /bam/$topic/cmnd/POWER -m ON
|
||||||
sleep 5
|
sleep 5
|
||||||
curl 'http://bauarbeiterlampe/ay?o=1'
|
mosquitto_pub -t /bam/$topic/cmnd/POWER -m OFF
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
services.logstash = {
|
services.logstash = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user