Commit f8f50f6b authored by Dylan Araps's avatar Dylan Araps

Distro: [Linux] Source /etc/*ease files

parent a37a3eec
...@@ -160,26 +160,21 @@ getdistro() { ...@@ -160,26 +160,21 @@ getdistro() {
distro="Android $(getprop ro.build.version.release)" distro="Android $(getprop ro.build.version.release)"
else else
# Workarounds are included in every shorthand option
case "$distro_shorthand" in
"on")
distro="$(awk -F'=' '/^NAME|VERSION_ID=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)"
[ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_ID|DISTRIB_RELEASE=/ {print $2}' /etc/openwrt_release)"
;;
"tiny") # Source the os-release file
distro="$(awk -F'=' '/^NAME=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)" for file in /etc/*ease /usr/lib/*ease; do
[ -z "$distro" ] && distro="$(awk -F'=' '/^TAILS_PRODUCT_NAME=/ {print $2}' /etc/*ease)" source "$file" 2>/dev/null
[ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_ID=/ {print $2}' /etc/openwrt_release)" done
;;
*) case "$distro_shorthand" in
distro="$(awk -F'=' '/^PRETTY_NAME=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)" "on") distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;;
[ -z "$distro" ] && distro="$(awk -F'=' '{print $2}' /etc/*ease)" "tiny") distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;;
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)" "off") distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;;
[ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_DESCRIPTION=/ {print $2}' /etc/openwrt_release)"
;;
esac esac
# Workarounds for distros that go against the os-release standard.
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)"
[ -z "$distro" ] && distro="$(awk -F'=' '{print $2}' /etc/*ease)"
fi fi
distro="${distro//\"}" distro="${distro//\"}"
distro="${distro//\'}" distro="${distro//\'}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment