From cef103059f8aee6c5b5941abca94722715b74e77 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 5 Aug 2019 17:34:32 -0700 Subject: [PATCH] moved email --- setup.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 0e28674..faae97c 100644 --- a/setup.sh +++ b/setup.sh @@ -507,13 +507,6 @@ echo "echo \"mailhub=${smtp}\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"UseSTARTTLS=YES\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh echo "echo \"root:${admins}\" >> /etc/ssmtp/revaliases" >> /mnt/setup-chroot.sh echo "chfn -f '${email}' root" >> /mnt/setup-chroot.sh -echo "echo \"\"" >> /mnt/setup-chroot.sh -echo "echo \"Sending SSH key via e-mail...\"" >> /mnt/setup-chroot.sh -if [ "$networktype" = "dhcp" ]; then - connection="`hostname -I` (`wget -qO - ifconfig.me`)" -else - connection="$address" -fi echo "serverinfo=\`cat \"/home/${admin}/.ssh/id_rsa\"\`" >> /mnt/setup-chroot.sh echo "serverinfo=\"Server available at $connection\\n\\n\$serverinfo\"; echo -e \"\$serverinfo\" | mail -s \"$hostname SSH key\" -r \"${email}\" \"\`cat /admins\`\"" >> /mnt/setup-chroot.sh @@ -557,6 +550,14 @@ echo " exit 122">> /mnt/setup-chroot.sh echo "fi">> /mnt/setup-chroot.sh echo "echo \"Done.\"" >> /mnt/setup-chroot.sh +echo "echo \"\"" >> /mnt/setup-chroot.sh +echo "echo \"Sending SSH key via e-mail...\"" >> /mnt/setup-chroot.sh +if [ "$networktype" = "dhcp" ]; then + connection="`hostname -I` (`wget -qO - ifconfig.me`)" +else + connection="$address" +fi + echo "exit 0" >> /mnt/setup-chroot.sh