Newer
Older
# VirtualBox VM Scripts v0.9
# by ulisse aka A. Livio Beccaria
#
# Common functions
#############################################
# templates folder
TEMPLATE_DIR="${SRC_DIR}/templates"
#-------------------------------------------------------------------------------
declare -a vms=()
create_vm_list () {
vms=()
for f in $(ls $SRC_DIR/settings/*.settings); do
vms=("${vms[@]}" "`basename $f .settings`")
done
}
print_vm_list () {
create_vm_list
echo "Available VM IDs:"
get_vm_id_by_name() {
f=`grep -liR "VM_NAME=\"$1\"" ${SRC_DIR}/settings/*.settings`
if [ "$f" != "" ]; then
echo `basename $f .settings`
else
echo ""
fi
}
echo "Usage: $0 <vm_id | vm_name> [--gui | --fullscreen] [--no-init] [--no-run]"
usage_vm-setup () {
echo >&2 "$@"
echo "Usage: $0 <vm_id> [-u | --update] [-d | --debug] [-h | --help]"
echo
echo -e "\t-u --update:\tSet VM for update (administrator only)"
echo -e "\t-d --debug:\tPrint some debug information"
echo -e "\t-h --help:\tPrint this help"
echo
print_vm_list
exit 1
}
usage_vbox2template () {
echo >&2 "$@"