Skip to content

Instantly share code, notes, and snippets.

@AliKhadivi
Created March 2, 2022 16:53
Show Gist options
  • Save AliKhadivi/49a538cba0f9cc97bb6861591a031353 to your computer and use it in GitHub Desktop.
Save AliKhadivi/49a538cba0f9cc97bb6861591a031353 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "___________________________________________"
echo "| Welcome to Jalgo Get free ssl Script (-: |"
echo "| POWERED BY JALGO.IR(Ali Khadivi) |"
echo "| Version: 1.0.0 |"
echo "|__________________________________________|"
echo ""
echo ""
echo " Lets GO ->"
echo ""
read -p "Enter Domain Name: " DomainName
echo ""
read -p "Do you want your certificate to be wildcard?[Please type (Y)es or (N)o] " IsWildCard
#if [[ $IsWildCard -eq "Yes" || $IsWildCard -eq "yes" || $IsWildCard -eq "Y" || $IsWildCard -eq "y" ]]; then
if [[ $IsWildCard = "Yes" || $IsWildCard = "yes" || $IsWildCard = "Y" || $IsWildCard = "y" ]]
then
CertDN="*.$DomainName"
certbot -d $CertDN --manual --preferred-challenges dns certonly
certbot -d $CertDN -d $DomainName --manual --preferred-challenges dns certonly
else
CertDN="$DomainName"
certbot -d $CertDN --manual --preferred-challenges dns certonly
fi
echo "DomainName: $CertDN"
echo ""
prkey="/etc/letsencrypt/live/$DomainName/privkey.pem"
fchain="/etc/letsencrypt/live/$DomainName/fullchain.pem"
echo ""
echo "Gnerate Certificate Sucsesfuly :-)"
echo "Start Certificate Convert"
echo ""
read -p "Enter Certificate File Name: " CertName
echo ""
echo ""
openssl pkcs12 -inkey $prkey -in $fchain -export -out "$CertName.pfx"
echo "End Converting!"
echo "Gnerate Sucsesfuly :-)"
echo ""
echo ""
echo "____________________________________"
echo "| POWERED BY Jalgo.IR(Ali Khadivi) |"
echo "|__________________________________|"
echo ""
echo ""
echo "Bye!"
echo ""
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment