From b8bddffdcac6e7b4296ea4576a8ba890c29444d4 Mon Sep 17 00:00:00 2001 From: insha-fab Date: Sun, 23 Aug 2026 23:31:41 +0530 Subject: [PATCH] Fix Ubuntu version detection in installer --- Ubuntu/install-eSim.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Ubuntu/install-eSim.sh b/Ubuntu/install-eSim.sh index 23072dc3e..8ab4aed00 100755 --- a/Ubuntu/install-eSim.sh +++ b/Ubuntu/install-eSim.sh @@ -22,8 +22,19 @@ # Function to detect Ubuntu version and full version string get_ubuntu_version() { - VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d '"' -f 2) - FULL_VERSION=$(lsb_release -d | grep -oP '\d+\.\d+\.\d+') + if [ ! -f /etc/os-release ]; then + echo "Error: /etc/os-release not found." + exit 1 + fi + + VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -d '"' -f 2) + + if [ -z "$VERSION_ID" ]; then + echo "Error: Unable to determine Ubuntu version." + exit 1 + fi + + FULL_VERSION="$VERSION_ID" echo "Detected Ubuntu Version: $FULL_VERSION" }