DistroInvetory Fixed bug in VM parsing
Bug prevented stoped VM's form being added to the reported
This commit is contained in:
@@ -46,9 +46,9 @@ if $CheckVM; then
|
|||||||
echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile
|
echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile
|
||||||
else
|
else
|
||||||
OSRELEASE=$(qm guest exec $ID -- cat /etc/os-release |jq -r '.["out-data"]')
|
OSRELEASE=$(qm guest exec $ID -- cat /etc/os-release |jq -r '.["out-data"]')
|
||||||
ParseOSRelease
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
ParseOSRelease
|
||||||
unset OSRELEASE OSYPE ID NAME STATUS DISTRO VERSION
|
unset OSRELEASE OSYPE ID NAME STATUS DISTRO VERSION
|
||||||
done
|
done
|
||||||
unset TYPE
|
unset TYPE
|
||||||
|
|||||||
@@ -220,8 +220,8 @@ ParseOSRelease()
|
|||||||
VERSION="$VERSION ($VERSIONNAME)"
|
VERSION="$VERSION ($VERSIONNAME)"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
DISTRO=N/A
|
if [ -z ${DISTRO+x} ]; then local DISTRO=N/A;fi
|
||||||
VERSION=N/A
|
if [ -z ${VERSION+x} ]; then local VERSION=N/A;fi
|
||||||
fi
|
fi
|
||||||
echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile
|
echo "$TYPE,$ID,$NAME,$STATUS,$DISTRO,$VERSION" | tee -a $InventoryFile
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user