|
|
|
@ -498,20 +498,6 @@ echo "chown -R ${admin}:${admin} \"/home/${admin}\"/.ssh" >> /mnt/setup-chroot.s
|
|
|
|
echo "HOME=\"/root\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "HOME=\"/root\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "HOSTNAME=\"$hostname\"" >> /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
|
|
|
|
|
|
|
|
echo "echo \"AuthPass=${emailpassword}\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
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 "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
|
|
|
|
|
|
|
|
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
errors=`chmod +x /mnt/setup-chroot.sh 2>&1 1>/dev/null`
|
|
|
|
errors=`chmod +x /mnt/setup-chroot.sh 2>&1 1>/dev/null`
|
|
|
|
if ! [ "$?" = "0" ]; then
|
|
|
|
if ! [ "$?" = "0" ]; then
|
|
|
|
echo "Failed to set execution permission on chroot script - $errors"
|
|
|
|
echo "Failed to set execution permission on chroot script - $errors"
|
|
|
|
@ -557,6 +543,19 @@ if [ "$networktype" = "dhcp" ]; then
|
|
|
|
else
|
|
|
|
else
|
|
|
|
connection="$address"
|
|
|
|
connection="$address"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
echo "echo \"AuthPass=${emailpassword}\" >> /etc/ssmtp/ssmtp.conf" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
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 "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
|
|
|
|
|
|
|
|
echo "echo \"Done.\"" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "exit 0" >> /mnt/setup-chroot.sh
|
|
|
|
echo "exit 0" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
|