diff options
author | Helmut Grohne <helmut@subdivi.de> | 2025-03-29 12:49:10 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2025-03-29 12:49:10 +0100 |
commit | d60586f47e277ef1f241963099bf96ab4811f67e (patch) | |
tree | 94aed73b3338e0bee87540a3e664b54482dbd454 /bin/debvm-create | |
parent | 1f768f1dae33667b5486678f6282a2fe3a530b66 (diff) | |
download | debvm-d60586f47e277ef1f241963099bf96ab4811f67e.tar.gz |
debvm-create: create a more sensible /etc/hosts
This is close to what the debian installer sets up.
Diffstat (limited to 'bin/debvm-create')
-rwxr-xr-x | bin/debvm-create | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/debvm-create b/bin/debvm-create index 0d89ad4..f6cd90a 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -350,9 +350,10 @@ case "$INITSYSTEM" in esac # set up a hostname +ETC_HOSTS_TEMPLATE='127.0.0.1 localhost\n127.0.1.1 %s\n::1 ip6-localhost ip6-loopback\n' set -- \ - "--customize-hook=echo $VMNAME >"'"$1/etc/hostname"' \ - "--customize-hook=echo 127.0.0.1 localhost $VMNAME >"'"$1/etc/hosts"' \ + "--customize-hook=echo '$VMNAME' >"'"$1/etc/hostname"' \ + "--customize-hook=printf '$ETC_HOSTS_TEMPLATE' '$VMNAME' >"'"$1/etc/hosts"' \ "$@" # allow password-less root login |