Skip to content

Instantly share code, notes, and snippets.

@karolyi
Created February 26, 2023 09:54
Show Gist options
  • Save karolyi/88bde0f56299e8eba7ebcd70e8dfc4d0 to your computer and use it in GitHub Desktop.
Save karolyi/88bde0f56299e8eba7ebcd70e8dfc4d0 to your computer and use it in GitHub Desktop.
#!/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