Code:
--------------------
#!/bin/bash
OLDPS=0
while true; do
PS=0
for i in MAC1 MAC2 MACN; do
echo "$i power ?"|nc6 -q 1 nas 9090 2>/dev/null|grep -q "power 1" && PS=1 &&
break
done
if [ $PS -ne $OLDPS ]; then
OLDPS=$PS
if [ $PS -eq 1 ]; then
echo "power on"
else
echo "power off"
fi
fi
sleep 10
done
--------------------
Replace MAC1... with you players' MACs, and nas with your LMS server
nc6 = 'netcat6' (http://www.deepspace6.net/projects/netcat6.html),
script should work with regular nc as well
[ extGUI4LMS - an alternative web interface: 'forum'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
/ 'homepage' (http://code.google.com/p/extgui4lms/) ]
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=99977
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix