tweaks
This commit is contained in:
@@ -466,11 +466,11 @@ echo "chmod g+w /var/spool/mqueue-client" >> /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 "echo \"admin: ${admins}\" >> /etc/ssmtp/revaliases" >> /mnt/setup-chroot.sh
|
||||
#echo "echo \"admin: ${admins}\" >> /etc/mail.rc" >> /mnt/setup-chroot.sh
|
||||
#echo "newaliases" >> /mnt/setup-chroot.sh
|
||||
#echo "systemctl unmask sendmail 2>&1 1>/dev/null && service sendmail 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 "cat \"/home/${admin}/.ssh/id_rsa.pub\" | mail -s \"$hostname SSH key\" -A \"/home/${admin}/.ssh/id_rsa.pub\" ${admins}" >> /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}\" ${admins}" >> /mnt/setup-chroot.sh
|
||||
#echo "mailq" >> /mnt/setup-chroot.sh
|
||||
#echo "while ! [ \"\$(/usr/bin/mailq)\" = \"mailq: Mail queue is empty\" ]; do echo \"waiting for e-mail to send...\"; sleep 5; done" >> /mnt/setup-chroot.sh
|
||||
#echo "service sendmail stop 2>&1 1>/dev/null" >> /mnt/setup-chroot.sh
|
||||
@@ -534,13 +534,18 @@ echo ""
|
||||
echo "Opening SSH port on firewall..."
|
||||
sed -ir 's/### RULES ###/### RULES ###\n-A ufw-user-input -i br0 -p tcp --dport 22 -j ACCEPT/g' /mnt/etc/ufw/user.rules 2>&1 1>/dev/null
|
||||
echo "Done."
|
||||
|
||||
# commented out for debugging
|
||||
echo ""
|
||||
echo "Clearing chroot configuration script..."
|
||||
rm /mnt/setup-chroot.sh
|
||||
echo "Done."
|
||||
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
echo ""
|
||||
echo "Unmounting chroot mounts..."
|
||||
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
|
||||
|
||||
Reference in New Issue
Block a user