|
|
|
@ -276,7 +276,7 @@ echo "echo \"Installing linux image, bash, screen, tmux, zfs, vim, curl, sharuti
|
|
|
|
# preconfigure postfix for no configuration
|
|
|
|
# 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/main_mailer_type string 'No configuration'\"" >> /mnt/setup-chroot.sh
|
|
|
|
#echo "debconf-set-selections <<< \"postfix postfix/mailname string $fqdn\"" >> /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 && apt autoremove -y 2>&1 1>/dev/null && DEBCONF_FRONTEND='noninteractive' apt install -y ifupdown dnsutils nfs-kernel-server apparmor-profiles 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 nfs-kernel-server apparmor-profiles vim bridge-utils putty-tools 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 "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
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
|
@ -445,6 +445,7 @@ echo 'echo "Done."'>> /mnt/setup-chroot.sh
|
|
|
|
#sendemail -t to@example.com -m "Here is the file." -a attachmentFile
|
|
|
|
#sendemail -t to@example.com -m "Here is the file." -a attachmentFile
|
|
|
|
echo "mkdir \"/home/${admin}/.ssh\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "mkdir \"/home/${admin}/.ssh\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "ssh-keygen -b 4096 -t rsa -q -f \"/home/${admin}/.ssh/id_rsa\" -N '$rootpassword'" >> /mnt/setup-chroot.sh
|
|
|
|
echo "ssh-keygen -b 4096 -t rsa -q -f \"/home/${admin}/.ssh/id_rsa\" -N '$rootpassword'" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
echo "cat /home/${admin}/.ssh/id_rsa.pub > /home/${admin}/.ssh/authorized_keys" >> /mnt/setup-chroot.sh
|
|
|
|
#echo "chmod 600 \"/home/${admin}/.ssh/id_rsa\"" >> /mnt/setup-chroot.sh
|
|
|
|
#echo "chmod 600 \"/home/${admin}/.ssh/id_rsa\"" >> /mnt/setup-chroot.sh
|
|
|
|
echo "chown -R ${admin}:${admin} \"/home/${admin}\"/.ssh" >> /mnt/setup-chroot.sh
|
|
|
|
echo "chown -R ${admin}:${admin} \"/home/${admin}\"/.ssh" >> /mnt/setup-chroot.sh
|
|
|
|
|
|
|
|
|
|
|
|
@ -577,11 +578,14 @@ echo " emailMessage=\"\${emailMessage}Pool: \$volume needs scrub \n\"" >> /
|
|
|
|
echo " fi" >> /mnt/zfshealth.sh
|
|
|
|
echo " fi" >> /mnt/zfshealth.sh
|
|
|
|
echo " done" >> /mnt/zfshealth.sh
|
|
|
|
echo " done" >> /mnt/zfshealth.sh
|
|
|
|
echo "fi" >> /mnt/zfshealth.sh
|
|
|
|
echo "fi" >> /mnt/zfshealth.sh
|
|
|
|
echo "echo -e \"\$emailMessage \n\n\n \`/sbin/zpool list\` \n\n\n \`/sbin/zpool status\`\" | mail -s \"\$emailSubject\" \"${admins}\"" >> /mnt/zfshealth.sh
|
|
|
|
echo "echo -e \"\$emailMessage \n\n\n \`/sbin/zpool list\` \n\n\n \`/sbin/zpool status\`\" | mail -r \"${email}\" -s \"\$emailSubject\" \"${admins}\"" >> /mnt/zfshealth.sh
|
|
|
|
echo "if [ \"\$problems\" -ne 0 ]; then logger \$emailSubject; fi" >> /mnt/zfshealth.sh
|
|
|
|
echo "if [ \"\$problems\" -ne 0 ]; then logger \$emailSubject; fi" >> /mnt/zfshealth.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "echo \"0 0 * * 1 /zfshealth.sh\" | crontab" >> /mnt/zfshealth.sh
|
|
|
|
chmod +x /mnt/zfshealth.sh
|
|
|
|
chmod +x /mnt/zfshealth.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "Unmounting chroot mounts..."
|
|
|
|
echo "Unmounting chroot mounts..."
|
|
|
|
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
|
|
|
|
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
|
|
|
|
|