From: Daniel Molkentin Date: Thu, 17 Sep 2020 22:15:04 +0000 (+0200) Subject: fix OS name detection X-Git-Tag: v0.7.0~25 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f8cfa50ba93f7ffeb3fca4bcc6fd01c3dfb925c;p=thirdparty%2Fdehydrated.git fix OS name detection before applying heuristics, use PRETTY_NAME from os-release(3), which reliably exists on all common linux distributions. keep the /etc/issue parsing as fallback. --- diff --git a/dehydrated b/dehydrated index dbbebbb..dad9f9f 100755 --- a/dehydrated +++ b/dehydrated @@ -1369,6 +1369,10 @@ command_version() { echo "" if [[ "${OSTYPE}" =~ "BSD" ]]; then echo "OS: $(uname -sr)" + elif [[ -e /etc/os-release ]]; then + ( . /etc/os-release && echo "OS: $PRETTY_NAME" ) + elif [[ -e /usr/lib/os-release ]]; then + ( . /usr/lib/os-release && echo "OS: $PRETTY_NAME" ) else echo "OS: $(cat /etc/issue | grep -v ^$ | head -n1 | _sed 's/\\(r|n|l) .*//g')" fi