homecontrol/scripts/actor_command.sh

16 lines
325 B
Bash
Raw Permalink Normal View History

2019-11-05 01:18:25 +01:00
#!/bin/bash
ID=${1:-1}
LEVEL=${2:-65280}
COMMAND=set_level
DATA='{"id":"'$ID'", "command":"'$COMMAND'", "data":{"level":"'$LEVEL'"}}'
REQ=POST
URL=http://localhost:5000/actor/command
echo "$REQ $URL --> $DATA"
read -p "continue?" -n 1 cont
curl \
-X $REQ $URL \
-H "Content-Type: application/json" \
-d "$DATA"