diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-06-13 18:00:42 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-06-13 18:00:42 -0300 |
commit | b495a4efce5b620b41c5c8463ed45860cef8daea (patch) | |
tree | 97818bc506f4fd05f6c3053413c4863d3cace670 /kvmx-create | |
parent | 85e1c1e9ca1acb346a4dd7b0d542467a5c57a9f3 (diff) | |
download | kvmx-b495a4efce5b620b41c5c8463ed45860cef8daea.tar.gz kvmx-b495a4efce5b620b41c5c8463ed45860cef8daea.tar.bz2 |
Enhance net_dns behavior
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 |