mirror of
https://github.com/Fluffy-Bean/dots.git
synced 2025-05-28 14:23:11 +00:00
12 lines
268 B
Bash
Executable file
12 lines
268 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Get power state
|
|
get_state=$(curl -s "http://192.168.0.8/cm?cmnd=Status")
|
|
state=$(echo $get_state | python3 -c "import sys, json; print(json.load(sys.stdin)['Status']['Power'])")
|
|
|
|
if [ $state -eq 1 ]; then
|
|
echo "ON";
|
|
else
|
|
echo "OFF";
|
|
fi
|
|
|