Make the double quotes around the distro name optional so it matches properly in Fedora (`NAME=Fedora`)
This commit is contained in:
Albert
2018-11-28 23:18:44 +01:00
committed by chriseth
parent 7cbf046864
commit 87f9834381
+1 -1
View File
@@ -55,7 +55,7 @@ detect_linux_distro() {
DISTRO=$(lsb_release -is)
elif [ -f /etc/os-release ]; then
# extract 'foo' from NAME=foo, only on the line with NAME=foo
DISTRO=$(sed -n -e 's/^NAME="\(.*\)\"/\1/p' /etc/os-release)
DISTRO=$(sed -n -e 's/^NAME="\?\([^"]*\)"\?$/\1/p' /etc/os-release)
elif [ -f /etc/centos-release ]; then
DISTRO=CentOS
else