070-register-vm
#!/bin/bash
#
# Use to register VM
#
if [ "$UID" -eq 0 ]
  then echo "This script should NOT be run as root."
  exit 1
fi
#
# Source config file
if [ ! -f ~/.vbconfig ]; then
    echo "Config File ~/.vbconfig not found!"
    echo "Run: set-folders to create .vbconfig"
    exit 1
fi
. ~/.vbconfig
#
if [[ ! ("$#" == 1) ]]; then
  echo "Usage for $0 : VM Name required as argument."
  exit 1
fi
VB_VM_NAME=$1
#
VBoxManage registervm $VB_VMS_LOC/$VB_VM_NAME/${VB_VM_NAME}.vbox
#
if [ $? -eq 0 ]; then
  echo "Done"
fi
#
exit

QR Code
QR Code scripts:070-register-vm (generated for current page)