I'm creating a script to check the requirements about VM in one of my customer. The first part of the script is check if the OS is virtual or not. To achieve this goal I create the following script. The problem is that even the system is virtual it is not working, I mean the test if not working!!! Does anyone can help and say if I did something wrong (I'm beginner in shell script and probably that is something wrong).
CHECK_SYSTEM=`dmidecode | grep -i "Product Name: VMware Virtual Platform"`
if [ "$CHECK_SYSTEM" = "Product Name: VMware Virtual Platform" ] ; then
printf "%s\n" "The system is Virtual"
else
printf "%s\n" "The system is not Virtual"
exit 192
fi