Skip to content
Snippets Groups Projects
Verified Commit 483b6d48 authored by David Beniamine's avatar David Beniamine
Browse files

transmit IP only when it answers to ping

parent 9b19e6bc
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,9 @@ do ...@@ -31,8 +31,9 @@ do
if [ $(echo "$MAC" | egrep -c "^([0-9a-f]{2}:?){6}$") -eq 1 ] if [ $(echo "$MAC" | egrep -c "^([0-9a-f]{2}:?){6}$") -eq 1 ]
then then
wakeonlan -i $broadcast "$MAC" wakeonlan -i $broadcast "$MAC"
sleep 5 sleep 3
bootedip=`getip $MAC` bootedip=`getip $MAC`
ping -c 3 $bootedip || bootedip=""
#echo "Sending ip" #echo "Sending ip"
echo "$bootedip" | netcat $subnet.51 9999 echo "$bootedip" | netcat $subnet.51 9999
#echo "Done" #echo "Done"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment