You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
423 B
22 lines
423 B
IP="192.168.1.120"
|
|
MAC="70:8B:CD:A7:07:78"
|
|
/usr/sbin/wol -i 192.168.1.255 -p 9 $MAC > /dev/null
|
|
ping -c 1 $IP > /dev/null
|
|
res=$?
|
|
count=0
|
|
stime=`date +%s`
|
|
while [ $res -ne 0 ]
|
|
do
|
|
/usr/sbin/wol -i 192.168.1.255 -p 9 $MAC > /dev/null
|
|
let count++
|
|
ping -c 1 $IP > /dev/null
|
|
res=$?
|
|
done
|
|
etime=`date +%s`
|
|
time=`expr $etime - $stime`
|
|
echo "Tries: $count"
|
|
if [ $count -gt 0 ]
|
|
then
|
|
echo "Time: $time"
|
|
fi
|
|
exit
|