Skip to content

Commit

Permalink
fix ID_LIKE mangling the apt source
Browse files Browse the repository at this point in the history
ID_LIKE in /etc/os-release may contain a string with multiple values,
e.g "ubuntu debian" on Pop_OS
This extracts the first value for the apt repo ID, for example "ubuntu".

* Update assets/install-scripts/install.sh

Co-authored-by: fheinecke <[email protected]>

---------

Co-authored-by: fheinecke <[email protected]>
  • Loading branch information
GavinFrazar and fheinecke committed Jan 14, 2025
1 parent 2b8724e commit f1a5b3e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions assets/install-scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ install_teleport() {
# shellcheck source=/dev/null
. $OS_RELEASE
fi
# Some $ID_LIKE values include multiple distro names in an arbitrary order, so
# evaluate the first one.
ID_LIKE="${ID_LIKE%% *}"

# detect architecture
ARCH=""
Expand Down Expand Up @@ -338,10 +341,8 @@ install_teleport() {
;;
*)
# before downloading manually, double check if we didn't miss any debian or
# rh/fedora derived distros using the ID_LIKE var. Some $ID_LIKE values
# include multiple distro names in an arbitrary order, so evaluate the first
# one.
case "$(echo "$ID_LIKE" | awk '{print $1}')" in
# rh/fedora derived distros using the ID_LIKE var.
case "${ID_LIKE}" in
ubuntu | debian)
install_via_apt_get
;;
Expand Down

0 comments on commit f1a5b3e

Please sign in to comment.