do not watch the IP address unless IP address was present in the first plac

This commit is contained in:
Calin Crisan 2016-05-21 15:47:34 +03:00
parent 8757a52ea0
commit 188b810dfa

View File

@ -92,7 +92,7 @@ start_wlan() {
dhclient -cf "$dh_conf" $wlan
fi
if [ "$ip_watch" == "yes" ]; then
if [ "$ip_watch" == "yes" ] && ip addr show dev $wlan | grep inet &>/dev/null; then
watch_ip $wlan &
fi
}
@ -149,7 +149,7 @@ start_eth() {
watch_eth &
fi
if [ "$ip_watch" == "yes" ]; then
if [ "$ip_watch" == "yes" ] && ip addr show dev $eth | grep inet &>/dev/null; then
watch_ip $eth &
fi
}