shelly_pool/restart_script

21 lines
426 B
Plaintext
Raw Normal View History

#!/bin/bash -e
source $(dirname $0)/shelly.conf
run=$(curl -s "${SHELLY_RPC}/Script.GetStatus?id=${SCRIPT_ID}" | jq .running)
test "$run" = true && exit
echo "restart script"
curl -s "${SHELLY_RPC}/Script.Start?id=${SCRIPT_ID}"
run=$(curl -s "${SHELLY_RPC}/Script.GetStatus?id=${SCRIPT_ID}" | jq .running)
if [ $run = true ]; then
echo "OK"
else
echo "ERROR"
fi
echo
curl -s "${SHELLY_RPC}/Sys.GetStatus" | jq .