24 lines
1.3 KiB
Bash
24 lines
1.3 KiB
Bash
###Fetch Config
|
|
mrepo=https://git.ictmaatwerk.com/VPS-scripts/AcmeSH
|
|
mbranch=main
|
|
|
|
if [ -z ${email+x} ]; then echo 'Error $email is not set' ; fi
|
|
|
|
mkdir -p /opt/acmesh /etc/acmesh/data /etc/acmesh/certs
|
|
curl -s https://codeload.github.com/acmesh-official/acme.sh/tar.gz/master -o /tmp/acmesh.tar.gz
|
|
tar -zxf /tmp/acmesh.tar.gz -C /opt/acmesh --strip-components=1
|
|
|
|
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/account.conf -o /etc/acmesh/data/account.conf
|
|
curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/conf/acme.sh.env -o /opt/acmesh/acme.sh.env
|
|
echo '. "/opt/acmesh/acme.sh.env"' >> ~/.bashrc
|
|
echo '42 0 * * * root "/opt/acmesh/acme.sh" --cron --home "/opt/acmesh/" --config-home "/etc/acmesh/data" > /dev/null' >> /etc/crontab
|
|
|
|
openssl dhparam -dsaparam -out /etc/acmesh/certs/ssl-dhparams.pem 4096 > $OUTPUT 2>&1
|
|
#openssl dhparam -out /etc/acmesh/certs/ssl-dhparams.pem 4096 #uses "strong" primes instead of DSA
|
|
#openssl dhparam -out /etc/acmesh/certs/ssl-dhparams.pem 2048 #use for quick generation, only for testing
|
|
|
|
/opt/acmesh/acme.sh --home "/opt/acmesh/" --config-home "/etc/acmesh/data" --upgrade > $OUTPUT 2>&1
|
|
/opt/acmesh/acme.sh --config-home "/etc/acmesh/data" --register-account > $OUTPUT 2>&1
|
|
/opt/acmesh/acme.sh --config-home "/etc/acmesh/data" --update-account --accountemail "$email" > $OUTPUT 2>&1
|
|
|