Last active
August 18, 2024 12:18
-
-
Save aenniw/19b2bb823085579046796ca7174a80a2 to your computer and use it in GitHub Desktop.
Setup letsencrypt for ocserv on OpenWRT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SINGLE_DOMAIN=${SINGLE_DOMAIN:-my.domain.org} | |
opkg install ca-certificates ca-bundle curl | |
hash acme.sh || ( curl https://get.acme.sh | sh && \ | |
ln -s /root/.acme/acme.sh /usr/bin/ ) | |
acme.sh --issue -d ${SINGLE_DOMAIN} --dns --force | |
sed -i '/acme.sh/d' /etc/crontabs/root | |
echo "8 0 * * * acme.sh --issue -d ${SINGLE_DOMAIN} --dns --force > /dev/null" >> /etc/crontabs/root | |
ln -s /root/.acme.sh/${SINGLE_DOMAIN}/fullchain.cer /etc/ocserv/server-cert.pem | |
ln -s /root/.acme.sh/${SINGLE_DOMAIN}/${SINGLE_DOMAIN}.key /etc/ocserv/server-key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment