#!/bin/bash # This file is part of VM-Experiments. # Licensed under the GPL-3.0-or-later. See LICENSE for details. trap '' SIGINT SIGTERM while true; do chroot /mnt /bin/bash -c "passwd root" if [ $? -eq 0 ]; then break fi done while true; do read -p "Enter the hostname: " hostname chroot /mnt /bin/bash -c "echo $hostname > /etc/hostname" if [ $? -eq 0 ]; then break fi done ip addr flush dev eth0 ip addr add 192.168.1.1/24 dev eth0 echo -e "\nauto eth0\niface eth0 inet static\n address 192.168.1.1\n netmask 255.255.255.0\n gateway 192.168.1.1" | tee -a /etc/network/interfaces cp dhcpd.conf /etc/dhcp/dhcpd.conf sed -i 's/^INTERFACES=.*/INTERFACES="eth0"/' /etc/default/isc-dhcp-server