RP_Jalousiecontrol/check_network.sh
2019-06-03 11:44:48 +02:00

13 lines
236 B
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
router="192.168.1.3"
interface="wlan0"
ping -w 30 -c 1 ${router} > /dev/null 2>&1
if [ $? -ne 0 ]; then
        echo "Restart ${interface}"
        ifdown ${interface}
        ifup ${interface}
fi