6 {"192.168.0.1", "windblade"},
7 {"192.168.0.20", "iceblade"},
11 --dofile("/etc/serverd.conf")
13 function gpio(host, n,o)
14 local str="cp2103gpio --serial="..host.." --gpio="..n.." --out="..o
19 function green(host, state)
27 function ylw(host, state)
35 function red(host, state)
43 function psu(host, state)
52 function is_alive(host, name)
54 result = os.execute("ping -w 1 -c 1 "..host.." > /dev/null")
65 ret = os.execute("sleep "..n);
67 error("Interrupted!");
72 function check_host_status(host, name)
73 if (is_alive(host, name)) then
83 for i,j in pairs(hosts) do
84 check_host_status(j[1],j[2])