comparison host/renewSsl.sh @ 2082:cdc9a31c6f71 ssltesting tip

update renewSsl.sh to reflect changes in directory structure
author Violet7
date Tue, 09 Dec 2025 17:53:16 -0800
parents 385ab09fb2ca
children
comparison
equal deleted inserted replaced
2081:7980c6707150 2082:cdc9a31c6f71
21 { 21 {
22 # Skip if not a directory 22 # Skip if not a directory
23 [ -d "$SITEROOT" ] || continue 23 [ -d "$SITEROOT" ] || continue
24 24
25 DOMAIN=$(basename "$SITEROOT") 25 DOMAIN=$(basename "$SITEROOT")
26 CSRFILE="$SITEROOT/$DOMAIN.csr" 26 SSLDIR="$SITEROOT/ssl"
27 FULLCHAIN="$SITEROOT/fullchain.cer" 27 CSRFILE="$SSLDIR/$DOMAIN.csr"
28 CHALLENGEDIR="$SITEROOT/site/.well-known/acme-challenge" 28 FULLCHAIN="$SSLDIR/fullchain.cer"
29 TMPOUT="/tmp/$DOMAIN.crt" 29 CHALLENGEDIR="$SITEROOT/.well-known/acme-challenge"
30 TMPOUT="$SSLDIR/$DOMAIN.crt.tmp"
30 echo "Processing domain: $DOMAIN" 31 echo "Processing domain: $DOMAIN"
31 32
32 # local_https.sh does not create a csr file, assume 33 # local_https.sh does not create a csr file, assume
33 # it is a self-signed local cert if it doesn't exist 34 # it is a self-signed local cert if it doesn't exist
34 if [ ! -f "$CSRFILE" ]; then 35 if [ ! -f "$CSRFILE" ]; then
42 --account-key "$KEYFILE" \ 43 --account-key "$KEYFILE" \
43 --csr "$CSRFILE" \ 44 --csr "$CSRFILE" \
44 --acme-dir "$CHALLENGEDIR" \ 45 --acme-dir "$CHALLENGEDIR" \
45 >"$TMPOUT" 46 >"$TMPOUT"
46 47
47 wc -c <$TMPOUT
48
49 # If TMPOUT is empty, something failed. 48 # If TMPOUT is empty, something failed.
49 # Do not modify the current fullchain.
50 if [ ! -s "$TMPOUT" ]; then 50 if [ ! -s "$TMPOUT" ]; then
51 echo "Error: $TMPOUT is empty - please see previous output for details.\nContinuing to next domain..." 51 echo "Error: $TMPOUT is empty - please see previous output for details.\nContinuing to next domain..."
52 rm -f "$TMPOUT" 52 rm -f "$TMPOUT"
53 continue 53 continue
54 fi 54 fi