OS: Fix ChromeOS detection.

This commit is contained in:
Dylan Araps 2018-04-02 10:05:12 +10:00
parent 648b5fb75e
commit 790401c6ea
1 changed files with 6 additions and 0 deletions

View File

@ -107,6 +107,12 @@ get_distro() {
elif [[ -d "/system/app/" && -d "/system/priv-app" ]]; then
distro="Android $(getprop ro.build.version.release)"
# Chrome OS doesn't conform to the /etc/*-release standard.
# While the file is a series of variables they can't be sourced
# by the shell since the values aren't quoted.
elif [[ -f "/etc/lsb-release" && "$(< /etc/lsb-release)" == *CHROMEOS* ]]; then
distro="$(awk -F '=' '/NAME|VERSION/ {printf $2 " "}' /etc/lsb-release)"
elif [[ -f "/etc/os-release" || \
-f "/usr/lib/os-release" || \
-f "/etc/openwrt_release" ]]; then