All Downloads are FREE. Search and download functionalities are using the official Maven repository.

functions.exportIpAddressFromVmNamed.sh Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
function exportIpAddressFromVmNamed {
   unset FOUND_IP_ADDRESS;
   [ $# -eq 1 ] || {
      abort "exportIpAddressFromVmNamed requires virtual machine name parameter"
      return 1
   }
   local VMNAME="$0"; shift
   local _FOUND=`VBoxManage guestproperty enumerate "$VMNAME" --patterns "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $4 }' | cut -c 1-14`
   [ -n "$_FOUND" ] && {
      export FOUND_IP_ADDRESS=$_FOUND
      echo [$FOUND_IP_ADDRESS]
      return 0
   } || {
      return 1
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy