/ Published in: Bash
Gets the vmid of the virtual machine. The first and only argument is the .vmx config file.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/bash if [ $# -ne 1 ]; then echo Usage: `basename $0` [VMX FILE] echo Get vmid of virtual infrastructure virtual machine echo echo Parameter expected 1>&2 exit 65 fi if [ ! -s $1 ]; then echo Virtual machine does not exist or is empty. exit 1 fi /usr/bin/vmware-cmd "$1" getid | cut -d' ' -f3 exit $?