Download acme_tiny.py script automatically and bug fixing
This commit is contained in:
parent
82c5e43aa6
commit
c521114971
@ -5,10 +5,10 @@ path="$( cd "$(dirname "$0")" ; pwd -P )"
|
|||||||
#############
|
#############
|
||||||
# variables
|
# variables
|
||||||
acme_dir=/srv/certs/acme-challenge/.well-known/acme-challenge
|
acme_dir=/srv/certs/acme-challenge/.well-known/acme-challenge
|
||||||
opt_folder=$path/opt
|
opt_dir=/srv/certs/.opt
|
||||||
account_key=$opt_folder/account.key
|
account_key=$opt_dir/account.key
|
||||||
acme_tiny=$opt_folder/acme_tiny.py
|
acme_tiny=$opt_dir/acme_tiny.py
|
||||||
openssl_conf=$opt_folder/openssl.conf
|
openssl_conf=$opt_dir/openssl.conf
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# script
|
# script
|
||||||
@ -21,6 +21,11 @@ if [ $# -eq 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$opt_dir" ]; then
|
||||||
|
echo "opt dir doesn't exists!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d "$acme_dir" ]; then
|
if [ ! -d "$acme_dir" ]; then
|
||||||
echo "acme directory ($acme_dir) doesn't exists!"
|
echo "acme directory ($acme_dir) doesn't exists!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -32,12 +37,13 @@ if [ ! -f "$account_key" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$acme_tiny" ]; then
|
if [ ! -f "$acme_tiny" ]; then
|
||||||
echo "Python script acme_tiny.py is missing"
|
echo "Python script acme_tiny.py is missing. Downloading..."
|
||||||
|
wget -qo $acme_tiny https://raw.githubusercontent.com/diafygi/acme-tiny/4.0.3/acme_tiny.py
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
acme_dir=${acme_dir%/}
|
acme_dir=${acme_dir%/}
|
||||||
opt_folder=${opt_folder%/}
|
opt_dir=${opt_dir%/}
|
||||||
|
|
||||||
# check if python is installed
|
# check if python is installed
|
||||||
command -v python >/dev/null 2>&1 || { echo >&2 "I require python but it's not installed. Aborting."; exit 1; }
|
command -v python >/dev/null 2>&1 || { echo >&2 "I require python but it's not installed. Aborting."; exit 1; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user