Merge pull request #159 from twouters/bugfix/dhcpcd_resolvconf_symlink

Fix dhcpcd failing on systemd-resolved stub
This commit is contained in:
rwmjones
2024-11-14 09:01:05 +00:00
committed by GitHub

View File

@@ -115,6 +115,10 @@ if test "$guestfs_network" = 1; then
# Two workarounds for Ubuntu:
touch /etc/fstab
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved
# Prevent dhcpcd from failing when /etc/resolv.conf is a dangling symlink.
if [ -L "/etc/resolv.conf" ] && [ ! -e "/etc/resolv.conf" ]; then
rm -f /etc/resolv.conf
fi
if dhclient --version >/dev/null 2>&1; then
dhclient $iface
elif dhcpcd $iface; then