summaryrefslogtreecommitdiff
path: root/init-tools.sh
diff options
context:
space:
mode:
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-xinit-tools.sh30
1 files changed, 13 insertions, 17 deletions
diff --git a/init-tools.sh b/init-tools.sh
index 9a83bda189..f965583dae 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -18,45 +18,41 @@ __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
- echo "fedora.23"
- return 0
- fi
- if [ "$(cat /etc/*-release | grep -cim1 24)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 fedora)" -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
- echo "opensuse.13.2"
+ if [ "$(cat /etc/os-release | grep -cim1 25)" -eq 1 ]; then
+ echo "fedora.25"
return 0
fi
- if [ "$(cat /etc/*-release | grep -cim1 42.1)" -eq 1 ]; then
+ elif [ "$(cat /etc/os-release | grep -cim1 opensuse)" -eq 1 ]; then
+ if [ "$(cat /etc/os-release | grep -cim1 42.1)" -eq 1 ]; then
echo "opensuse.42.1"
return 0
fi