adding nummer5 tools
This commit is contained in:
1
nummer5/hosts.conf
Normal file
1
nummer5/hosts.conf
Normal file
@@ -0,0 +1 @@
|
||||
hosts="pine01.wks pine02.wks pine03.wks pine04.wks pine05.wks adm01.wks ebin01.wks ebin02.wks"
|
||||
10
nummer5/nummer5-host-powercycle.sh
Executable file
10
nummer5/nummer5-host-powercycle.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
host=$1
|
||||
echo "${host} turning it off"
|
||||
mosquitto_pub -h mqtt.wks -t switch_cloud/switch/${host}/command -m OFF
|
||||
sleep 2
|
||||
echo "${host} turning it on"
|
||||
mosquitto_pub -h mqtt.wks -t switch_cloud/switch/${host}/command -m ON
|
||||
|
||||
ping -W 1 ${host}
|
||||
9
nummer5/nummer5-hosts-alive.sh
Executable file
9
nummer5/nummer5-hosts-alive.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
. hosts.conf
|
||||
for host in $hosts; do
|
||||
if ping -c 1 -W 1 "$host" >/dev/null; then
|
||||
echo "$host is alive"
|
||||
else
|
||||
echo "$host is pining for the fjords"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user