misc: replace certbot-auto with certbot
This commit is contained in:
parent
240b033e76
commit
b814827df1
|
@ -23,11 +23,32 @@ echo "by providing an email address for important account notifications"
|
||||||
echo -n "Enter your email and press [ENTER]: "
|
echo -n "Enter your email and press [ENTER]: "
|
||||||
read EMAIL
|
read EMAIL
|
||||||
|
|
||||||
cd /usr/local/sbin
|
if [ ! -x "$(command -v certbot)" ] ; then
|
||||||
|
DISTRO=$(lsb_release -is)
|
||||||
if [ ! -f certbot-auto ] ; then
|
DISTRO_VERSION=$(lsb_release -rs)
|
||||||
wget https://dl.eff.org/certbot-auto
|
if [ "$DISTRO" = "Debian" ]; then
|
||||||
chmod a+x ./certbot-auto
|
apt-get update
|
||||||
|
apt-get -y install certbot
|
||||||
|
elif [ "$DISTRO" = "Ubuntu" ]; then
|
||||||
|
if [ "$DISTRO_VERSION" = "20.04" ] || [ "$DISTRO_VERSION" = "19.10" ]; then
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install software-properties-common
|
||||||
|
add-apt-repository -y universe
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install certbot
|
||||||
|
elif [ "$DISTRO_VERSION" = "18.04" ]; then
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install software-properties-common
|
||||||
|
add-apt-repository -y universe
|
||||||
|
add-apt-repository -y ppa:certbot/certbot
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install certbot
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$DISTRO $DISTRO_VERSION is not supported"
|
||||||
|
echo "Only Debian 9,10 and Ubuntu 18.04,19.10,20.04 are supported"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CRON_FILE="/etc/cron.weekly/letsencrypt-renew"
|
CRON_FILE="/etc/cron.weekly/letsencrypt-renew"
|
||||||
|
@ -35,7 +56,7 @@ if [ ! -d "/etc/cron.weekly" ] ; then
|
||||||
mkdir "/etc/cron.weekly"
|
mkdir "/etc/cron.weekly"
|
||||||
fi
|
fi
|
||||||
echo "#!/bin/bash" > $CRON_FILE
|
echo "#!/bin/bash" > $CRON_FILE
|
||||||
echo "/usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log" >> $CRON_FILE
|
echo "/usr/bin/certbot renew >> /var/log/le-renew.log" >> $CRON_FILE
|
||||||
|
|
||||||
CERT_KEY="/etc/letsencrypt/live/$DOMAIN/privkey.pem"
|
CERT_KEY="/etc/letsencrypt/live/$DOMAIN/privkey.pem"
|
||||||
CERT_CRT="/etc/letsencrypt/live/$DOMAIN/fullchain.pem"
|
CERT_CRT="/etc/letsencrypt/live/$DOMAIN/fullchain.pem"
|
||||||
|
@ -51,13 +72,13 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
|
||||||
chmod u+x $TURN_HOOK
|
chmod u+x $TURN_HOOK
|
||||||
sed -i "s/jitsi-meet.example.com/$DOMAIN/g" $TURN_HOOK
|
sed -i "s/jitsi-meet.example.com/$DOMAIN/g" $TURN_HOOK
|
||||||
|
|
||||||
./certbot-auto certonly --noninteractive \
|
/usr/bin/certbot certonly --noninteractive \
|
||||||
--webroot --webroot-path /usr/share/jitsi-meet \
|
--webroot --webroot-path /usr/share/jitsi-meet \
|
||||||
-d $DOMAIN \
|
-d $DOMAIN \
|
||||||
--agree-tos --email $EMAIL \
|
--agree-tos --email $EMAIL \
|
||||||
--deploy-hook $TURN_HOOK
|
--deploy-hook $TURN_HOOK
|
||||||
else
|
else
|
||||||
./certbot-auto certonly --noninteractive \
|
/usr/bin/certbot certonly --noninteractive \
|
||||||
--webroot --webroot-path /usr/share/jitsi-meet \
|
--webroot --webroot-path /usr/share/jitsi-meet \
|
||||||
-d $DOMAIN \
|
-d $DOMAIN \
|
||||||
--agree-tos --email $EMAIL
|
--agree-tos --email $EMAIL
|
||||||
|
@ -79,7 +100,7 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
|
||||||
service nginx reload
|
service nginx reload
|
||||||
elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
|
elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
|
||||||
|
|
||||||
./certbot-auto certonly --noninteractive \
|
/usr/bin/certbot certonly --noninteractive \
|
||||||
--webroot --webroot-path /usr/share/jitsi-meet \
|
--webroot --webroot-path /usr/share/jitsi-meet \
|
||||||
-d $DOMAIN \
|
-d $DOMAIN \
|
||||||
--agree-tos --email $EMAIL
|
--agree-tos --email $EMAIL
|
||||||
|
|
Loading…
Reference in New Issue