nummer5 scripts
This commit is contained in:
12
bin/nummer5-host-powercycle.sh
Executable file
12
bin/nummer5-host-powercycle.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
. hosts.conf
|
||||
|
||||
host=$1
|
||||
hostname=$(echo ${host} | sed s/\.${domain}//)
|
||||
MOSQ="mosquitto_pub -h mqtt.wks -t switch_cloud/switch/${hostname}/command -m"
|
||||
echo "${host} turning it off"
|
||||
${MOSQ} OFF
|
||||
sleep 2
|
||||
echo "${host} turning it on"
|
||||
${MOSQ} ON
|
||||
ping -W 1 ${host}
|
||||
Reference in New Issue
Block a user