4 dofile("/etc/serverd.conf")
6 function gpio(host, n,o)
7 local str="cp2103gpio --serial="..host.." --gpio="..n.." --out="..o
12 function green(host, state)
20 function ylw(host, state)
28 function red(host, state)
36 function psu(host, state)
45 function is_alive(host, name)
47 result = os.execute("ping -w 1 -c 1 "..host.." > /dev/null")
58 ret = os.execute("sleep "..n);
60 error("Interrupted!");
65 function check_host_status(host, name)
66 if (is_alive(host, name)) then
76 for i,j in pairs(hosts) do
77 check_host_status(j[1],j[2])