#!/bin/bash
#  v3 - VPS helper configuration

set -e

source "/home/zwelch/src/mcf/mcsh-release/install/share/mcsh/mcsh.sh"

######
# VPS CLI

v3_deploy() {
	has_args 1 "$@"
	local name=$1
	v10 hd exists "$name" || b9 wizard magic "$name"
	v10 vm create "$name"
	v10 vm hd attach "$name"
	v10 vm start "$name"
}

v3_retire() {
	has_args 1 "$@"
	local name=$1
	v10 vm poweroff "$name"
	v10 vm delete "$name"
}

v3_redeploy() {
	has_args 1 "$@"
	local name=$1
	v3_retire "$name"
	v3_deploy "$name"
}


######
# Main

v3_desc() { echo "Virtual Private Server (VPS) helper"; }

v3_usage() {
	cat <<USAGE
<cmd> ...
VPS Commands:
	deploy <name>			Bootstrap and deploy a new VM
	retire <name>			Poweroff and delete the VM
	redeploy <name>			Retire then redeploy the VM
USAGE
}

app_run "$@"

View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:34:47 PDT 2017 by mcsh d14 v0.23.0.