OpenMarine
restart wlan9 - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3)
+--- Thread: restart wlan9 (/showthread.php?tid=4340)

Pages: 1 2 3


RE: restart wlan9 - tobias.e - 2022-12-05

i am still waiting for the next crash, but this script should do the trick:
Code:
#!/bin/bash 
myIP=10.10.10.1
while :
do
    sleep 30;
    if ping -c 1 -W 1 "$myIP" 2>&1 > /dev/null ; then
          echo `date` "$myIP is alive"
    else
          echo `date` "$myIP is dead"
        logger "Trying to restart wlan9"
        /home/pi/.openplotter/start1.sh 
    fi
done
It needs to be run in the background, using nohup or some other way.