Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for systemd resolved configuration on ubuntu 18.04 #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,20 @@ generate_resolvconf() {
# execute_chroot_command "netconfig update -f"
fi
# else
NAMESERVERFILE="$FOLD/hdd/etc/resolv.conf"
NAMESERVERFILE="$FOLD/hdd/etc/resolv.conf"
SYSTEMD_RESOLV_CONF="$FOLD/hdd/etc/systemd/resolved.conf"
if [ "$IAM" = "ubuntu" ] && [ "$IMG_VERSION" -ge 1604 ] && \
[ -L "$NAMESERVERFILE" ] && [ -e "$SYSTEMD_RESOLV_CONF" ]; then
if [ "$V6ONLY" -eq 1 ]; then
debug "# skipping IPv4 DNS resolvers"
sed -i "s/^#DNS=/DNS=${DNSRESOLVER_V6[*]}/g" "$SYSTEMD_RESOLV_CONF"
elif [ -n "$DOIPV6" ]; then
sed -i "s/^#DNS=/DNS=${NAMESERVER[*]}\ ${DNSRESOLVER_V6[*]}/g" "$SYSTEMD_RESOLV_CONF"
else
sed -i "s/^#DNS=/DNS=${NAMESERVER[*]}/g" "$SYSTEMD_RESOLV_CONF"
fi

else
echo "### $COMPANY installimage" > "$NAMESERVERFILE"
echo "# nameserver config" >> "$NAMESERVERFILE"

Expand All @@ -2619,7 +2632,7 @@ generate_resolvconf() {
echo "nameserver ${DNSRESOLVER_V6[$index]}" >> "$NAMESERVERFILE"
done
fi
# fi
fi

return 0
}
Expand Down