Cleanup distro detection
This commit is contained in:
parent
7c62ff2d26
commit
8311d3f2e3
9
neofetch
9
neofetch
|
@ -456,21 +456,18 @@ x32="x86"
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" )
|
"Linux" )
|
||||||
if type -p lsb_release >/dev/null 2>&1; then
|
if type -p lsb_release >/dev/null 2>&1; then
|
||||||
distro="$(lsb_release -d 2>/dev/null | awk -F':' '/Description/ {printf $2}')"
|
distro="$(lsb_release -d 2>/dev/null | awk -F ':' '/Description/ {printf $2}')"
|
||||||
distro=${distro/[[:space:]]}
|
distro=${distro/[[:space:]]}
|
||||||
|
|
||||||
elif type -p crux >/dev/null 2>&1; then
|
elif type -p crux >/dev/null 2>&1; then
|
||||||
distro="$(crux)"
|
distro="$(crux)"
|
||||||
|
|
||||||
else
|
else
|
||||||
distro="$(grep -h '^NAME=' /etc/*ease)"
|
distro="$(awk -F 'NAME="|"' '/^NAME=/ {printf $2}' /etc/*ease)"
|
||||||
|
|
||||||
# Workaround for distros that store the value differently.
|
# Workaround for distros that store the value differently.
|
||||||
[ -z "$distro" ] && distro="$(grep -h 'TAILS_PRODUCT_NAME' /etc/*ease)"
|
[ -z "$distro" ] && distro="$(awk -F 'TAILS_PRODUCT_NAME="|"' '/^TAILS_PRODUCT_NAME=/ {printf $2}' /etc/*ease)"
|
||||||
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)"
|
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)"
|
||||||
|
|
||||||
distro=${distro/*NAME\=}
|
|
||||||
distro=${distro//\"}
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Reference in New Issue