Fix a distro detection bug when '/etc/*ease' doesn't use quotes

This commit is contained in:
Dylan 2016-04-01 18:01:24 +11:00
parent 766569fb10
commit 399747a5e2
1 changed files with 2 additions and 1 deletions

View File

@ -464,7 +464,8 @@ case "$os" in
distro="$(crux)" distro="$(crux)"
else else
distro="$(awk -F 'NAME="|"' '/^NAME=/ {printf $2}' /etc/*ease)" distro="$(awk -F 'NAME=' '/^NAME=/ {printf $2}' /etc/*ease)"
distro=${distro//\"}
# Workaround for distros that store the value differently. # Workaround for distros that store the value differently.
[ -z "$distro" ] && distro="$(awk -F 'TAILS_PRODUCT_NAME="|"' '/^TAILS_PRODUCT_NAME=/ {printf $2}' /etc/*ease)" [ -z "$distro" ] && distro="$(awk -F 'TAILS_PRODUCT_NAME="|"' '/^TAILS_PRODUCT_NAME=/ {printf $2}' /etc/*ease)"