diff --git a/DistroInventory.sh b/DistroInventory.sh index a52a326..663db3a 100644 --- a/DistroInventory.sh +++ b/DistroInventory.sh @@ -40,9 +40,10 @@ if $CheckVM; then NAME=$(qm config $ID | grep name |sed 's/name: //') OSYPE=$(qm config $ID | grep ostype |sed 's/ostype: //') if [ $STATUS == "running" ]; then - if [ [$OSYPE == *"win"* ]]; then + if [[ $OSYPE == *"win"* ]]; then DISTRO=Windows VERSION=$(qm guest exec $ID "systeminfo" |jq -r '.["out-data"]'| grep "OS Name" |sed -e 's/OS Name://' -e 's/^[ \t]*//' -e 's/Microsoft Windows//' -e 's/^[ \t]*//') + echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile else OSRELEASE=$(qm guest exec $ID -- cat /etc/os-release |jq -r '.["out-data"]') ParseOSRelease