add script to toggle Delock WiFi switch with Tasmota remotely
This commit is contained in:
parent
0bea8f2eb0
commit
bd0cfb1b62
1 changed files with 13 additions and 0 deletions
13
toggle_delock_light.sh
Executable file
13
toggle_delock_light.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Highly specific script
|
||||
#
|
||||
# Logs in to jumphost, that miraculously is the only host being able to reach
|
||||
# the powerline-connected WiFi switch. It grabs the Delock switch's current IP
|
||||
# address based on its MAC address and sents the Tasmota command to toggle the
|
||||
# switch ON/OFF
|
||||
|
||||
jumphost_addr=n.n.n.n
|
||||
jumphost_user=jumphostuser
|
||||
target_mac="<some-mac-address>"
|
||||
ssh $jumphost_user@$jumphost_addr "/sbin/arp -n | grep $target_mac | awk {'print \$1'} | xargs -I _ curl -s http://_/cm?cmnd=Power%20TOGGLE"
|
||||
Loading…
Add table
Add a link
Reference in a new issue