ansible/roles/pi-standard-setup/files/wifi-watchdog.sh

11 lines
325 B
Bash
Raw Permalink Normal View History

2020-05-10 15:25:38 +02:00
#!/bin/bash
if /sbin/ifconfig wlan0 | /bin/grep -q "inet addr:" ; then
logger "Tested Inet connection - everything ok"
echo "Tested Inet connection - everything ok"
else
logger "Network connection down! Attempting reconnection."
echo "Network connection down! Attempting reconnection."
/sbin/ifup --force wlan0
fi