Mercurial > hg > rlgallery-misc
view scripts/create-combined-pemfile @ 97:fb292a0184d9
Add a page about UltraRogue.
author | John "Elwin" Edwards |
---|---|
date | Mon, 05 Apr 2021 21:57:20 -0400 |
parents | 08c6e8c87caa |
children |
line wrap: on
line source
#!/bin/sh # Combines a private key and host cert into a single pemfile, for webservers # that require it. if [ $# -lt 1 ] then echo "No domains given." exit 1 fi if [ "$1" = "-r" ] then RESTART=1 shift else RESTART=0 fi for DOMAIN in "$@" do LINKDIR=/etc/letsencrypt/live/"$DOMAIN" if [ ! -d "$LINKDIR" ] then echo "No certificates for $DOMAIN, skipping" continue fi REALCERTFILE=`readlink -f "$LINKDIR"/cert.pem` PEMFILE=`dirname "$REALCERTFILE"`/combined.pem touch "$PEMFILE" chown root:root "$PEMFILE" chmod 400 "$PEMFILE" cat "$LINKDIR"/privkey.pem "$LINKDIR"/cert.pem >"$PEMFILE" ln -s -f -r "$PEMFILE" "$LINKDIR"/combined.pem done if [ "$RESTART" = 1 ] then systemctl restart lighttpd fi