Created
February 26, 2023 09:54
-
-
Save karolyi/88bde0f56299e8eba7ebcd70e8dfc4d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
STATE='ON' | |
if [[ $1 == 'off' ]]; then | |
STATE='OFF' | |
fi | |
STR_1='<?xml version="1.0" encoding="UTF8"?><SMARTPLUG id="edimax"><CMD id="setup"><Device.System.Power.State>' | |
STR_2='</Device.System.Power.State></CMD></SMARTPLUG>' | |
curl http://192.168.1.141:10000/smartplug.cgi -u admin:plugpassword --data "$STR_1$STATE$STR_2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment