Compare commits

..

No commits in common. "dba0e2f9ad9a8b82410fda398dfcf9a90009b4c3" and "f2d3880dd967f3ffc98b23ea8071fda3d463c203" have entirely different histories.

View File

@ -37,20 +37,20 @@ if [ ! -d "$acme_dir" ]; then
exit 1 exit 1
fi fi
if [ ! -s "$account_key" ]; then if [ ! -f "$account_key" ]; then
echo "Account Key doesn't exists!" echo "Account Key doesn't exists!"
exit 1 exit 1
fi fi
if [ ! -s "$acme_tiny" ]; then if [ ! -f "$acme_tiny" ]; then
echo -n "Python script acme_tiny.py is missing. Downloading... " echo "Python script acme_tiny.py is missing. Downloading... "
wget -qO "$acme_tiny" https://raw.githubusercontent.com/diafygi/acme-tiny/4.0.4/acme_tiny.py wget -qo $acme_tiny https://raw.githubusercontent.com/diafygi/acme-tiny/4.0.4/acme_tiny.py
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo -ne "\nCould not download acme_tiny.py script.\n" echo "Could not download acme_tiny.py script."
rm -rf "$acme_tiny" rm -rf $acme_tiny
exit 1 exit 1
fi fi
echo -ne "Finished\n" echo "Finished"
fi fi
acme_dir=${acme_dir%/} acme_dir=${acme_dir%/}
@ -70,7 +70,7 @@ do
continue continue
fi fi
if [ ! -s "$arg/domain.conf" ]; then if [ ! -f "$arg/domain.conf" ]; then
echo "Configuration file doen't exists!" echo "Configuration file doen't exists!"
continue continue
fi fi
@ -94,7 +94,7 @@ do
# domain key # domain key
key="$arg/$NAME.key" key="$arg/$NAME.key"
if [ ! -s "$key" ]; then if [ ! -f "$key" ]; then
echo "Domain key doesn't exists. Generating..." echo "Domain key doesn't exists. Generating..."
openssl genrsa 4096 > "$key" openssl genrsa 4096 > "$key"
#openssl ecparam -out "$key" -name secp384r1 -genkey #openssl ecparam -out "$key" -name secp384r1 -genkey
@ -103,7 +103,7 @@ do
# domain csr # domain csr
csr="$arg/$NAME.csr" csr="$arg/$NAME.csr"
if [ ! -s "$csr" ]; then if [ ! -f "$csr" ]; then
echo "Domain csr file doesn't exists. Generating..." echo "Domain csr file doesn't exists. Generating..."
if [ ${#DOMAINS[@]} -eq 1 ]; then if [ ${#DOMAINS[@]} -eq 1 ]; then
# single domain # single domain
@ -131,13 +131,7 @@ do
continue continue
fi fi
if [ -s "$arg/tmp.pem" ]; then mv -f "$arg/tmp.pem" "$arg/$NAME.pem"
mv -f "$arg/tmp.pem" "$arg/$NAME.pem"
else
echo "New certificate for \"$NAME\" doesn't exists or is empty"
rm -rf "$arg/tmp.pem"
continue
fi
echo "Certificate for \"$NAME\" successfully created!" echo "Certificate for \"$NAME\" successfully created!"
counter=$((counter+1)) counter=$((counter+1))