Skip to content

Commit

Permalink
add support for systemd resolved configuration on ubuntu 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
pbyatshon committed Aug 1, 2018
1 parent 66358d4 commit 14a5505
Showing 1 changed file with 15 additions and 2 deletions.
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

0 comments on commit 14a5505

Please sign in to comment.