restart_script
* run hourly from crontab * workaround for killed script on Shelly
This commit is contained in:
parent
eb8584a576
commit
c69c4775a0
20
restart_script
Executable file
20
restart_script
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/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 .
|
||||||
|
|
Loading…
Reference in New Issue
Block a user