Added script for generating a CSV file of CT/VM Guests
This commit is contained in:
16
functions.sh
16
functions.sh
@@ -208,4 +208,20 @@ UpgradeRelease () {
|
||||
echo "Warning: Release upgrade are supported for this distro"
|
||||
#exit 100
|
||||
fi
|
||||
}
|
||||
|
||||
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)
|
||||
if [ ! -z "$VERSIONNAME" ]; then
|
||||
VERSION="$VERSION ($VERSIONNAME)"
|
||||
fi
|
||||
else
|
||||
DISTRO=N/A
|
||||
VERSION=N/A
|
||||
fi
|
||||
echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile
|
||||
}
|
||||
Reference in New Issue
Block a user