Skip to content

Instantly share code, notes, and snippets.

@aenniw
Last active July 17, 2019 12:01
Show Gist options
  • Save aenniw/19b2bb823085579046796ca7174a80a2 to your computer and use it in GitHub Desktop.
Save aenniw/19b2bb823085579046796ca7174a80a2 to your computer and use it in GitHub Desktop.
Setup letsencrypt for ocserv on OpenWRT
#!/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