Created
June 5, 2017 23:00
-
-
Save dadosch/2de2fe812c31293180350fe842d2d37b to your computer and use it in GitHub Desktop.
Script to switch on and off Wifi power socket from ALDI Model 45112
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
#!/bin/bash | |
prefix="01 40 " | |
mac="yo ur ma c- -- --" | |
on="10 5B 94 D4 2E F5 C0 1E 30 2B 1B 7C B7 A7 D8 EA B0" | |
off="10 66 30 BC FE 88 83 0C B4 EE AB 4A 78 43 56 AB 9F" | |
hex_string=$prefix$mac$off | |
echo $hex_string | |
echo -n $hex_string | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' | nc -u -w1 IP-ADDRESS 8530 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment