Skip to content

Instantly share code, notes, and snippets.

@dadosch
Created June 5, 2017 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadosch/2de2fe812c31293180350fe842d2d37b to your computer and use it in GitHub Desktop.
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
#!/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