Commit 5b14480d authored by gsell's avatar gsell
Browse files

Merge branch '59-determine-os-release-is-broken-on-linux' into 'master'

Resolve "determine OS release is broken on Linux"

Closes #59

See merge request !24
parents c6f90a57 7df9fe71
......@@ -272,9 +272,21 @@ There is NO WARRANTY, to the extent permitted by law."
}
std.get_os_release_linux() {
source /etc/os-release
local lsb_release=$(which lsb_release)
local ID=''
local VERSION_ID=''
if [[ -n $(which lsb_release) ]]; then
ID=$(lsb_release -is)
VERSION_ID=$(lsb_release -rs)
elif [[ -r '/etc/os-release' ]]; then
source /etc/os-release
else
std::die 4 "Cannot determin OS release!\n"
fi
case "${ID}" in
science | rhel | centos | fedora )
RedHatEnterpriseServer | RedHatEnterprise | Scientific | rhel | centos | fedora )
echo "rhel${VERSION_ID%.*}"
;;
* )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment