Skip to content

Instantly share code, notes, and snippets.

@whs
Last active July 17, 2019 12:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whs/4dfaec165c2807a4957f to your computer and use it in GitHub Desktop.
Save whs/4dfaec165c2807a4957f to your computer and use it in GitHub Desktop.
Dumb bulk cert generator
#!/bin/sh
BIN=/home/whs/.local/share/letsencrypt/bin/letsencrypt
SHUT_SVC=1
if [ "$SHUT_SVC" = "1" ]; then
sudo service nginx stop
sudo service apache2 stop
fi
SITES=certs/*
if [ "$*" != "" ]; then
SITES=$*
fi
for i in $SITES; do
DOMAINS=""
CONTENTS=`cat $i`
if [ "$?" != 0 ]; then
exit $?
fi
for line in $CONTENTS; do
DOMAINS=$DOMAINS" -d $line"
done
sudo $BIN certonly --agree-tos -a standalone --standalone-supported-challenges http-01 $DOMAINS
done
if [ "$SHUT_SVC" = "1" ]; then
sudo service apache2 start
sudo service nginx start
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment