FIX #1
This commit is contained in:
24
container-filesystem/usr/local/sbin/certbot-set-default.sh
Normal file
24
container-filesystem/usr/local/sbin/certbot-set-default.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
LIVE_DIR="/etc/letsencrypt/live"
|
||||
DEFAULT_LINK="${LIVE_DIR}/default"
|
||||
|
||||
CERT_DIR=""
|
||||
if test "$1" != "" ; then
|
||||
CERT_DIR="$1"
|
||||
elif test "$RENEWED_LINEAGE" != "" ; then
|
||||
CERT_DIR="$RENEWED_LINEAGE"
|
||||
else
|
||||
echo "You must name a certificate dir either as argument or via RENEWED_LINEAGE" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
cert_name=`basename $CERT_DIR`
|
||||
echo "Setting $cert_name as default certificate name"
|
||||
if test -L "$DEFAULT_LINK" ; then
|
||||
rm "$DEFAULT_LINK"
|
||||
elif test -e "$DEFAULT_LINK" ; then
|
||||
echo "Not a symbolic link: $DEFAULT_LINK" >&2
|
||||
exit 78
|
||||
fi
|
||||
ln -s "$cert_name" "$DEFAULT_LINK"
|
||||
Reference in New Issue
Block a user