From ca64b8ab16ea067db00a791a9e9ef606073b617f Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Fri, 14 Jun 2024 12:43:36 -0700 Subject: [PATCH] add Debian 12 compat, enhance letsencrypt detection --- install.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index e708726..e41b2fb 100755 --- a/install.sh +++ b/install.sh @@ -11,12 +11,18 @@ if [ "${EUID}" -ne 0 ]; then exit fi -# check for existing Let's Encrypt install -if [ -d "/etc/letsencrypt/" ]; then - echo "WARNING: Let's Encrypt is already installed." - echo "This installer will overwrite existing configurations." - echo -e "You have five seconds to execute ctrl-c to cancel this install.\a" - sleep 5 +# check for Ubuntu 22.04 (jammy) or Debian 12 (bookworm) +os_codename=`lsb_release -cs` +if [ $os_codename != jammy ] && [ $os_codename != bookworm ]; then + echo "This installer only runs on Ubuntu 22.04 (jammy) or Debian 12 (Bookworm), bailing out." + exit 1 +fi + +# check for existing web server software installs +if [ -d "/etc/letsencrypt/" ] || [ -d "/opt/certbot/" ] || [ -f "/usr/bin/certbot" ]; then + echo "NOTICE: Let's Encrypt is already installed." + echo "You must purge any existing certbot installs before running this." + exit 1 fi # Old apt installation instructions