From 640ac3b41b2123c1260567967266acc55e093a18 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 17 Dec 2023 10:18:17 -0500 Subject: [PATCH] ubuntu jammy topgrade fix for libssl1.1 --- 30-Checking_Topgrade_Installation_Status.sh | 12 ++++++++++++ common/functions.sh | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/30-Checking_Topgrade_Installation_Status.sh b/30-Checking_Topgrade_Installation_Status.sh index 7412b8a..d50b22e 100644 --- a/30-Checking_Topgrade_Installation_Status.sh +++ b/30-Checking_Topgrade_Installation_Status.sh @@ -54,6 +54,18 @@ else update_topgrade fi +# Ubuntu Jammy need focal repo to get this +if ! is_shared_lib_present libssl.so.1.1 +then + if get_dist == "Ubuntu" ]] + then + printf "$COL_YELLOW" "** libssl.so.1.1 library missing, installing now" + echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list + apt update + apt install -y libssl1.1 + fi +fi + printf "$COL_LIGHT_BLUE" "checking for topgrade confs" custom_topgrade_confs_path="/etc/topgrade" custom_topgrade_confs_git="https://git.deathbybandaid.net/deathbybandaid/topgrade.git" diff --git a/common/functions.sh b/common/functions.sh index 52bcc96..11c3f9c 100644 --- a/common/functions.sh +++ b/common/functions.sh @@ -1,5 +1,9 @@ #!/bin/bash +get_dist() { + echo $(lsb_release -si) +} + is_command() { local check_command="$1" command -v "${check_command}" >/dev/null 2>&1 @@ -97,3 +101,16 @@ service_exists() { return 1 fi } + +is_shared_lib_present() { + local libtocheck="$1" + printf "$COL_YELLOW" "Checking if Shared library is installed: $libtocheck" + if ! ldconfig -p | grep $libtocheck + then + printf "$COL_YELLOW" "$libtocheck is not installed" + return 0 + else + printf "$COL_YELLOW" "$libtocheck is installed" + return 1 + fi +}