@@ -16,18 +16,20 @@ if [ $? -eq 0 ]; then
|
||||
fi
|
||||
echo "no."
|
||||
|
||||
echo -n "Trying to wake up $host ... "
|
||||
echo -n "Trying to wake up $host ($timeout) ... "
|
||||
|
||||
while [ $timeout -gt 0 ]; do
|
||||
wol $host_mac >/dev/null 2>&1
|
||||
# wol $host_mac >/dev/null 2>&1
|
||||
wakeonlan $host_mac >/dev/null 2>&1
|
||||
ping -c 1 $host >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "success."
|
||||
exit 0
|
||||
fi
|
||||
((timeout--))
|
||||
((timeout=timeout-1))
|
||||
sleep 1
|
||||
echo "no."
|
||||
echo -n "Re-trying to wake up $host ... "
|
||||
echo -n "Re-trying to wake up $host ($timeout) ... "
|
||||
done
|
||||
|
||||
echo "no."
|
||||
|
Reference in New Issue
Block a user