summaryrefslogtreecommitdiff
path: root/init-tools.sh
diff options
context:
space:
mode:
authorMatt Ellis <matell@microsoft.com>2016-12-12 14:40:55 -0800
committerMatt Ellis <matell@microsoft.com>2017-01-24 10:51:32 -0800
commit13593513cbabfc4cbbb50e62bedbe0ce6f93488a (patch)
treeb68d308ae799ee3d9e5ac689375d9c7e4e9b4de1 /init-tools.sh
parent8d0946c0fb7c597f9de0dbb997fe63d59376f38b (diff)
downloadcoreclr-13593513cbabfc4cbbb50e62bedbe0ce6f93488a.tar.gz
coreclr-13593513cbabfc4cbbb50e62bedbe0ce6f93488a.tar.bz2
coreclr-13593513cbabfc4cbbb50e62bedbe0ce6f93488a.zip
Only consider /etc/os-release for distro info
This is in line with how the `dotnet` tooling works.
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-xinit-tools.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/init-tools.sh b/init-tools.sh
index 9a83bda189..9a5c8b32b2 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -18,45 +18,45 @@ __INIT_TOOLS_DONE_MARKER=$__PROJECT_JSON_PATH/done
# Extended version of platform detection logic from dotnet/cli/scripts/obtain/dotnet-install.sh 16692fc
get_current_linux_name() {
# Detect Distro
- if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then
- if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 ubuntu)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 16.04)" -eq 1 ]; then
echo "ubuntu.16.04"
return 0
fi
- if [ "$(cat /etc/*-release | grep -cim1 16.10)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 16.10)" -eq 1 ]; then
echo "ubuntu.16.10"
return 0
fi
echo "ubuntu"
return 0
- elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 centos)" -eq 1 ]; then
echo "centos"
return 0
- elif [ "$(cat /etc/*-release | grep -cim1 rhel)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 rhel)" -eq 1 ]; then
echo "rhel"
return 0
- elif [ "$(cat /etc/*-release | grep -cim1 debian)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 debian)" -eq 1 ]; then
echo "debian"
return 0
- elif [ "$(cat /etc/*-release | grep -cim1 alpine)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 alpine)" -eq 1 ]; then
echo "alpine"
return 0
- elif [ "$(cat /etc/*-release | grep -cim1 fedora)" -eq 1 ]; then
- if [ "$(cat /etc/*-release | grep -cim1 23)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 fedora)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 23)" -eq 1 ]; then
echo "fedora.23"
return 0
fi
- if [ "$(cat /etc/*-release | grep -cim1 24)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 24)" -eq 1 ]; then
echo "fedora.24"
return 0
fi
- elif [ "$(cat /etc/*-release | grep -cim1 opensuse)" -eq 1 ]; then
- if [ "$(cat /etc/*-release | grep -cim1 13.2)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 opensuse)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 13.2)" -eq 1 ]; then
echo "opensuse.13.2"
return 0
fi
- if [ "$(cat /etc/*-release | grep -cim1 42.1)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 42.1)" -eq 1 ]; then
echo "opensuse.42.1"
return 0
fi