Recently bought some brand new devices.
When they are booted up, they connect to the wifi absolutely fine.
If the wifi goes down, i want the Pi to notice then try to reconnect.
Ive written a cron for this to happen, but it isnt working:
ping -c2 {our firewall IP address}
if [ $? != 0 ]
then
sudo ifconfig wlan0 down
sleep 2
sudo ifconfig wlan0 up
else
echo " "
fi
any idea on why this isnt working or how i should actually be writing it?
thanks
When they are booted up, they connect to the wifi absolutely fine.
If the wifi goes down, i want the Pi to notice then try to reconnect.
Ive written a cron for this to happen, but it isnt working:
ping -c2 {our firewall IP address}
if [ $? != 0 ]
then
sudo ifconfig wlan0 down
sleep 2
sudo ifconfig wlan0 up
else
echo " "
fi
any idea on why this isnt working or how i should actually be writing it?
thanks
Statistics: Posted by Timmypat23 — Fri Oct 25, 2024 9:39 am