DistroInventory added windows support

Fixed bugs in os-Release file parsing
This commit is contained in:
2023-11-19 23:44:45 +01:00
parent 1ad843d62a
commit dfe29be6cb
2 changed files with 18 additions and 11 deletions

View File

@@ -213,9 +213,9 @@ UpgradeRelease () {
ParseOSRelease()
{
if [ ! -z "$OSRELEASE" ]; then
DISTRO=$(printf "$OSRELEASE" | awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)
VERSION=$(printf "$OSRELEASE" | awk -F= '$1=="VERSION_ID" { print $2 ;}' /etc/os-release |tr -d '"' )
VERSIONNAME=$(printf "$OSRELEASE" | awk -F= '$1=="VERSION_CODENAME" { print $2 ;}' /etc/os-release)
DISTRO=$(printf "$OSRELEASE" | awk -F= '$1=="ID" { print $2 ;}')
VERSION=$(printf "$OSRELEASE" | awk -F= '$1=="VERSION_ID" { print $2 ;}' |tr -d '"')
VERSIONNAME=$(printf "$OSRELEASE" | awk -F= '$1=="VERSION_CODENAME" { print $2 ;}')
if [ ! -z "$VERSIONNAME" ]; then
VERSION="$VERSION ($VERSIONNAME)"
fi