#!/bin/bash
echo "Wake on lan attempt for $1"
HWADDR=`curl  -s  http://localhost/xymon/hobbit-cgi/svcstatus.sh?CLIENT=$1|grep ether|grep txq|tr -s [:space:]| cut -d" " -f3|uniq`
for mac in $HWADDR
do
    echo
    echo "####################################################"
    echo "wol:  $mac"
    /usr/bin/wol -v $mac
    echo
    echo "etherwake: $mac "
    sudo /usr/sbin/etherwake -D $mac 2>&1
    echo "####################################################"
done



