fix #10 do not run dnsfix if no eth0

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
Justin Cormack 2016-01-19 16:00:01 +00:00
parent f596bac5a7
commit 6df16df027

View File

@ -12,7 +12,8 @@ start()
{
ebegin "Testing DNS resolution"
dig localhost 2>&1 > /dev/null || printf "nameserver 8.8.8.8\nnameserver 8.8.4.4\n" > /etc/resolv.conf
ifconfig eth0 2>1 >/dev/null && \
(dig localhost 2>&1 > /dev/null || printf "nameserver 8.8.8.8\nnameserver 8.8.4.4\n" > /etc/resolv.conf)
eend $? "DNS fix failed"
}