@ -271,14 +271,9 @@ echo "cp /usr/share/zoneinfo/$timezone /etc/localtime" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "echo \"\"" >> /mnt/setup-chroot.sh
echo "echo \"\"" >> /mnt/setup-chroot.sh
echo "echo \"Installing linux image, bash, screen, tmux, zfs, vim, curl, sharutils, libvirt-bin, docker, dnsutils, dosfstools, openssh, bridge-utils, net-utils, ufw ...\"" >> /mnt/setup-chroot.sh
echo "echo \"Installing linux image, ifupdown dnsutils nfs-kernel-server apparmor-profiles vim bridge-utils net-tools bash screen tmux zfs-initramfs dosfstools mailutils ssmtp openssh-server ufw docker.io sharutils ...\"" >> /mnt/setup-chroot.sh
# preconfigure postfix for no configuration
echo "errors=\$(DEBCONF_FRONTEND='noninteractive' apt install -y --no-install-recommends linux-image-generic 2>&1 1>/dev/null && apt purge -y netplan 2>&1 1>/dev/null && apt autoremove -y 2>&1 1>/dev/null && DEBCONF_FRONTEND='noninteractive' apt install -y ifupdown dnsutils nfs-kernel-server apparmor-profiles vim bridge-utils net-tools bash screen tmux zfs-initramfs dosfstools mailutils ssmtp openssh-server ufw docker.io sharutils 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
#echo "debconf-set-selections <<< \"postfix postfix/main_mailer_type string 'No configuration'\"" >> /mnt/setup-chroot.sh
#echo "debconf-set-selections <<< \"postfix postfix/mailname string $fqdn\"" >> /mnt/setup-chroot.sh
echo "errors=\$(DEBCONF_FRONTEND='noninteractive' apt install -y --no-install-recommends linux-image-generic 2>&1 1>/dev/null && apt purge -y netplan 2>&1 1>/dev/null && apt autoremove -y 2>&1 1>/dev/null && DEBCONF_FRONTEND='noninteractive' apt install -y ifupdown dnsutils nfs-kernel-server apparmor-profiles vim bridge-utils putty-tools net-tools bash screen tmux zfs-initramfs dosfstools mailutils ssmtp openssh-server ufw docker.io sharutils 2>&1 1>/dev/null)" >> /mnt/setup-chroot.sh
#echo "DEBCONF_FRONTEND='noninteractive' apt install -y --no-install-recommends linux-image-generic && apt install -y vim bash screen tmux zfs-initramfs dosfstools openssh-server ufw sendmail mailutils docker.io sharutils" >> /mnt/setup-chroot.sh
echo 'if ! [ "$?" = "0" ]; then ' >> /mnt/setup-chroot.sh
echo 'if ! [ "$?" = "0" ]; then ' >> /mnt/setup-chroot.sh
echo ' echo "Failed to install preliminary software - $errors"' >> /mnt/setup-chroot.sh
echo ' echo "Failed to install preliminary software - $errors"' >> /mnt/setup-chroot.sh
@ -468,7 +463,7 @@ else
connection = " $address "
connection = " $address "
fi
fi
# --content-filename=\"${hostname}.ssh.key\" --content-name=\"${hostname}.ssh.key\"
# --content-filename=\"${hostname}.ssh.key\" --content-name=\"${hostname}.ssh.key\"
echo " (echo \"Server available at $connection \"; cat \"/home/ ${ admin } /.ssh/id_rsa\") | mail -s \" $hostname SSH key\" -A \"/home/ ${ admin } /.ssh/id_rsa\" \"${ admins } \" " >> /mnt/setup-chroot.sh
echo " (echo \"Server available at $connection \"; cat \"/home/ ${ admin } /.ssh/id_rsa\") | mail -s \" $hostname SSH key\" -A \"/home/ ${ admin } /.ssh/id_rsa\" -r \"${ email } \" \"${ admins } \" " >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "exit 0" >> /mnt/setup-chroot.sh
echo "exit 0" >> /mnt/setup-chroot.sh
@ -524,7 +519,7 @@ echo "fi">> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
echo "systemctl enable cron" >> /mnt/setup-chroot.sh
echo "systemctl unmask cron 2>/dev/null 1>/dev/null; systemctl enable cron 2>/dev/null 1>/dev/null " >> /mnt/setup-chroot.sh
#crontab -l > mycron
#crontab -l > mycron
#echo new cron into cron file
#echo new cron into cron file
#echo "00 09 * * 1-5 echo hello" >> mycron
#echo "00 09 * * 1-5 echo hello" >> mycron