diff options
Diffstat (limited to 'kvmx-create')
-rwxr-xr-x | kvmx-create | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kvmx-create b/kvmx-create index a908663..56b08b6 100755 --- a/kvmx-create +++ b/kvmx-create @@ -364,10 +364,7 @@ EOF # Second stage procedure function __kvmx_create_custom_second_stage { - if [ ! -z "$net_ip" ] && [ ! -z "$net_mask" ] && [ ! -z "$net_gateway" ] && [ -z "$net_dns" ]; then - # DNS config - echo "nameserver $net_dns" > $WORK/etc/resolv.conf - + if [ ! -z "$net_ip" ] && [ ! -z "$net_mask" ] && [ ! -z "$net_gateway" ]; then # Networking: eth0 cat <<-EOF | $SUDO tee $WORK/etc/network/interfaces.d/eth0 > /dev/null auto eth0 @@ -403,6 +400,15 @@ iface ens3 inet dhcp EOF fi + # DNS config + if [ ! -z "$net_dns" ]; then + if [ "$net_dns" == "host" ]; then + cp /etc/resolv.conf $WORK/etc/resolv.conf + else + echo "nameserver $net_dns" > $WORK/etc/resolv.conf + fi + fi + # Locale $APT_INSTALL locales echo "LANG=$LANG" | $SUDO tee $WORK/etc/default/locale > /dev/null |