From 6d712ebf2d5bcf1448b2f9cf642ccebc90bd032c Mon Sep 17 00:00:00 2001 From: sean Date: Wed, 17 Jul 2019 16:37:08 -0700 Subject: [PATCH] tweaks --- setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index ef0e472..238b201 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 && apt autoremove -y 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 && apt install -y postfix 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 @@ -457,10 +457,11 @@ echo "echo \"UseSTARTTLS=YES\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"\"" >> /mnt/setup-chroot.sh echo "echo \"Sending SSH key via e-mail...\"" >> /mnt/setup-chroot.sh +echo "mkdir -p /var/spool/postfix 2>&1 1>/dev/null && chown postfix:postfix /var/spool/postfix 2>&1 1>/dev/null" >> /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 ! [ \`/usr/bin/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