#!/bin/bash
# v3 - VPS helper configuration
set -e
source "/home/zwelch/src/mcf/mcsh/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 "$@"
Generated on Tue Apr 25 21:20:00 PDT 2017 by mcsh i7 v0.18.0.