ask for letsencrypt cert installation

This commit is contained in:
Danny 2018-05-23 16:14:26 +02:00
parent 813eb460a3
commit 67bbdf34eb
1 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,8 @@ if [ "$EUID" -ne 0 ]; then
exit
fi
echo "Welcome to the Fathom quick installer. Press CTRL-C at any time to abort."
function download_fathom() {
# Download latest version of the Fathom application
echo "Downloading Fathom"
@ -185,6 +187,11 @@ END
echo ""
}
function new_cerbot_cert() {
certbot --nginx -d "$SERVER_NAME"
echo ""
}
# Download Fathom if command does not exist
FATHOM_PATH="$(command -v fathom)"
if [ "$FATHOM_PATH" != "" ]; then
@ -217,6 +224,14 @@ if [ "$(command -v systemctl)" ]; then
fi
fi;
# Ask to request new LetsEncrypt certificate
if [ "$SERVER_NAME" != "" ] && [ "$(command -v certbot)" ]; then
read -p "LetsEncrypt detected. Request SSL certificate for $SERVER_NAME? (Y/n): " CONTINUE
if [ "$CONTINUE" != "n" ]; then
new_cerbot_cert
fi
fi;
# Try to be helpful
if [ "$SERVER_NAME" != "" ] && [ "$SERVICE_NAME" != "" ]; then
echo "Success! You should now see Fathom running on $SERVER_NAME"