Skip to content

Commit

Permalink
Use os-release to determine OS distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapona committed Mar 14, 2024
1 parent 6ffd186 commit a2a9f07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions usr/lib/pi-top-os-apt-installer/pi-top-apt-source-manager
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ main() {
fi

DISTRO="$(lsb_release -cs 2>/dev/null)"
if [ -z "${DISTRO}" ] && [ -f /etc/os-release ]; then
DISTRO="$(cat /etc/os-release | grep VERSION_CODENAME | cut -d'=' -f2)"
fi
if [ -z "${DISTRO}" ] || [[ ! " ${VALID_DISTROS[@]} " =~ " ${DISTRO} " ]]; then
echo "Unsupported distro: ${DISTRO} (supported: ${VALID_DISTROS[@]})"
exit 1
Expand Down

0 comments on commit a2a9f07

Please sign in to comment.