Skip to content

Commit

Permalink
Fix Update install.sh
Browse files Browse the repository at this point in the history
 - Fix, if lsb_release does not exist
  • Loading branch information
Lord-Grey authored Aug 26, 2024
1 parent feeead7 commit 46744d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@ check_architecture() {

function get_distro() {
# Determine the used Linux distribution.
distro=$(lsb_release -si 2>/dev/null | awk '{print $1}' || cat /etc/os-release | grep -oP '^ID=["\"]?\K\w+' || echo "unknown")
echo ${distro} | tr '[:upper:]' '[:lower:]'
if command -v lsb_release >/dev/null 2>&1; then
distro=$(lsb_release -si | awk '{print $1}')
else
distro=$(cat /etc/os-release | grep -oP '^ID=["\"]?\K\w+')
fi

echo "${distro}" | tr '[:upper:]' '[:lower:]'
}

# Adds a 'sudo' prefix if sudo is available to execute the given command
Expand Down

0 comments on commit 46744d3

Please sign in to comment.