From cca57584f92c89fb3179829e99e5c694e6d332fb Mon Sep 17 00:00:00 2001 From: sean Date: Wed, 17 Jul 2019 15:43:38 -0700 Subject: [PATCH] tweaks --- setup.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index ed72554..6097141 100644 --- a/setup.sh +++ b/setup.sh @@ -275,7 +275,7 @@ echo "echo \"Installing linux image, bash, screen, tmux, zfs, vim, sharutils, do # preconfigure postfix for no configuration 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 && DEBCONF_FRONTEND='noninteractive' apt install -y ifupdown dnsutils 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 "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 && DEBCONF_FRONTEND='noninteractive' apt install -y ifupdown dnsutils vim bridge-utils net-tools bash screen tmux zfs-initramfs dosfstools mailutils postfix 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 @@ -285,20 +285,10 @@ echo " exit 1">> /mnt/setup-chroot.sh echo "fi">> /mnt/setup-chroot.sh echo "echo \"Done.\"" >> /mnt/setup-chroot.sh - - - - - - - - - # network configuration should have optional static configuration - not just DHCP, it's very important echo "systemctl unmask networking 2>&1 1>/dev/null && systemctl enable networking 2>&1 1>/dev/null" >> /mnt/setup-chroot.sh - # configure docker storage to use zfs mkdir -p /mnt/etc/docker echo "{\"storage-driver\":\"zfs\"}" > /mnt/etc/docker/daemon.json @@ -320,7 +310,6 @@ echo 'if ! [ "$?" = "0" ]; then '>> /mnt/setup-chroot.sh echo ' echo "Failed to mount EFI partition or install grub-EFI - $errors"' >> /mnt/setup-chroot.sh echo " exit 1">> /mnt/setup-chroot.sh echo "fi">> /mnt/setup-chroot.sh - echo 'echo "Done."' >> /mnt/setup-chroot.sh echo "echo ''" >> /mnt/setup-chroot.sh @@ -456,6 +445,7 @@ echo "chmod g+w /var/spool/mqueue-client" >> /mnt/setup-chroot.sh echo "HOME=\"/root\"" >> /mnt/setup-chroot.sh echo "HOSTNAME=\"$hostname\"" >> /mnt/setup-chroot.sh +echo "echo \"FromLineOverride=YES\" > /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"root=admin\" > /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"hostname=${fqdn}\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"AuthUser=${email}\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh @@ -470,7 +460,7 @@ echo "echo \"Sending SSH key via e-mail...\"" >> /mnt/setup-chroot.sh echo "systemctl unmask postfix 2>&1 1>/dev/null && service postfix start 2>&1 1>/dev/null" >> /mnt/setup-chroot.sh echo "cat \"/home/${admin}/.ssh/id_rsa.pub\" | mail -s \"$hostname SSH key\" -A \"/home/${admin}/.ssh/id_rsa.pub\" admin" >> /mnt/setup-chroot.sh echo "cat /home/parker/.ssh/id_rsa.pub | mail -s \"${fqdn} SSH key\" -A /home/parker/.ssh/id_rsa.pub -r \"${email}\" admin" >> /mnt/setup-chroot.sh -echo "while ! [ \"\$(mailq)\" = \"mailq: Mail queue is empty\" ]; do sleep 1; done" >> /mnt/setup-chroot.sh +echo "while ! [ \`mailq\` = \"mailq: Mail queue is empty\" ]; do sleep 1; done" >> /mnt/setup-chroot.sh echo "service postfix stop 2>&1 1>/dev/null" >> /mnt/setup-chroot.sh echo "echo \"Done.\"" >> /mnt/setup-chroot.sh