mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix the fix for stupid 'search' stuff in resolvconf ... + let's in fact ignore it if it does exists in /etc/resolv.conf >.>
This commit is contained in:
parent
3cb47a226f
commit
97ab8c91f8
2 changed files with 4 additions and 4 deletions
|
@ -59,9 +59,9 @@ do_post_regen() {
|
||||||
sed -E "s/^(domain|search)/#\1/g" -i /run/resolvconf/interface/*.dhclient
|
sed -E "s/^(domain|search)/#\1/g" -i /run/resolvconf/interface/*.dhclient
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep -q '^supersede domain-name "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo '^supersede domain-name "";' >> /etc/dhcp/dhclient.conf
|
grep -q '^supersede domain-name "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo 'supersede domain-name "";' >> /etc/dhcp/dhclient.conf
|
||||||
grep -q '^supersede domain-search "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo '^supersede domain-search "";' >> /etc/dhcp/dhclient.conf
|
grep -q '^supersede domain-search "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo 'supersede domain-search "";' >> /etc/dhcp/dhclient.conf
|
||||||
grep -q '^supersede name "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo '^supersede name "";' >> /etc/dhcp/dhclient.conf
|
grep -q '^supersede name "";' /etc/dhcp/dhclient.conf 2>/dev/null || echo 'supersede name "";' >> /etc/dhcp/dhclient.conf
|
||||||
systemctl restart resolvconf
|
systemctl restart resolvconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ class IPDiagnoser(Diagnoser):
|
||||||
def good_resolvconf(self):
|
def good_resolvconf(self):
|
||||||
content = read_file("/etc/resolv.conf").strip().split("\n")
|
content = read_file("/etc/resolv.conf").strip().split("\n")
|
||||||
# Ignore comments and empty lines
|
# Ignore comments and empty lines
|
||||||
content = [l.strip() for l in content if l.strip() and not l.strip().startswith("#")]
|
content = [l.strip() for l in content if l.strip() and not l.strip().startswith("#") and not l.strip().startswith("search")]
|
||||||
# We should only find a "nameserver 127.0.0.1"
|
# We should only find a "nameserver 127.0.0.1"
|
||||||
return len(content) == 1 and content[0].split() == ["nameserver", "127.0.0.1"]
|
return len(content) == 1 and content[0].split() == ["nameserver", "127.0.0.1"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue