summaryrefslogtreecommitdiff
path: root/helpers/lh_chroot_hosts
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/lh_chroot_hosts')
-rwxr-xr-xhelpers/lh_chroot_hosts14
1 files changed, 11 insertions, 3 deletions
diff --git a/helpers/lh_chroot_hosts b/helpers/lh_chroot_hosts
index 9807433..2cd8f08 100755
--- a/helpers/lh_chroot_hosts
+++ b/helpers/lh_chroot_hosts
@@ -51,13 +51,21 @@ case "${1}" in
if [ -f chroot/etc/hosts ]
then
# Save hosts file
- cp chroot/etc/hosts chroot/etc/hosts.orig
+ mv chroot/etc/hosts chroot/etc/hosts.orig
fi
+ # Creating hosts file
+
+cat > chroot/etc/hosts << EOF
+127.0.0.1 localhost localhost.localdomain
+127.0.1.1 debian
+EOF
+
if [ -f /etc/hosts ]
then
- # Copy hosts file
- cp /etc/hosts chroot/etc/hosts
+ # Append hosts file
+ #grep -e "127.0.0.1" -e "127.0.1.1" /etc/hosts >> chroot/etc/hosts
+ cat /etc/hosts >> chroot/etc/hosts
fi
# Creating stage file