Make an install script

This commit is contained in:
Bob Mottram 2015-06-17 21:09:44 +01:00
parent 7bcc5f414c
commit d300d22f89
1 changed files with 7 additions and 0 deletions

View File

@ -132,9 +132,16 @@ cp /etc/ssl/certs/dovecot-ca.crt /home/$USERNAME/emailcert
mv /etc/ssl/private/$USERNAME.key /home/$USERNAME/emailcert mv /etc/ssl/private/$USERNAME.key /home/$USERNAME/emailcert
mv /etc/ssl/certs/$USERNAME.crt /home/$USERNAME/emailcert mv /etc/ssl/certs/$USERNAME.crt /home/$USERNAME/emailcert
# make an install script
echo '#!/bin/bash' > /home/$USERNAME/emailcert/install.sh
echo "sudo mv $USERNAME.crt /etc/ssl/certs" >> /home/$USERNAME/emailcert/install.sh
echo "sudo mv $USERNAME.key /etc/ssl/private" >> /home/$USERNAME/emailcert/install.sh
echo 'exit 0' >> /home/$USERNAME/emailcert/install.sh
# set permissions for the user # set permissions for the user
chmod -R 755 /home/$USERNAME/emailcert chmod -R 755 /home/$USERNAME/emailcert
chown -R $USERNAME:$USERNAME /home/$USERNAME/emailcert chown -R $USERNAME:$USERNAME /home/$USERNAME/emailcert
chmod +x /home/$USERNAME/emailcert/install.sh
shred -zu /etc/ssl/requests/$USERNAME.csr shred -zu /etc/ssl/requests/$USERNAME.csr