Hi guys, I understand very little about the command line so if someone can help me with a ping script I would be very grateful.
What you do is run a ping every time you get a reply command.
The spoiler scrpt performs an action if the ping fails, someone can tailor it to run only this action if the ping succeed (once ip 10.64.64.64)?
#!/bin/sh
tries=0
while [[ $tries -lt 5 ]]
do
if /bin/ping -c 1 8.8.8.8 >/dev/null
then
exit 0
fi
tries=$((tries+1))
done
sleep 5
ifup wan3
With this I want to restart the wan3 for correct IP (sometimes the modem fails to get the real IP but initiated with standard IP).
Grateful for the attention!