forked from NationTech/harmony
Design learning tools
Provide diagrams for a Virtualized Execution Environment Propose interfaces for a cli toolkit
This commit is contained in:
77
examples/opnsense/scripts/harmony-ve-vm
Executable file
77
examples/opnsense/scripts/harmony-ve-vm
Executable file
@@ -0,0 +1,77 @@
|
||||
|
||||
#! /bin/bash
|
||||
|
||||
harmony-ve-vm()(
|
||||
|
||||
set -eu
|
||||
|
||||
[ "${1:-}" != "-d" ] || { set -x ; shift ; }
|
||||
trap '[ "$?" = "0" ] || >&2 echo ABNORMAL TERMINATION' EXIT
|
||||
|
||||
BASE_DIR=$(readlink -f "$(dirname "${BASH_SOURCE}")/..")
|
||||
|
||||
_short_help(){
|
||||
|
||||
cat <<-EOM
|
||||
|
||||
NAME
|
||||
|
||||
harmony-ve-mv
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Manage virtalized hosts (VM) dependencies by Harmony Virtual Execution Environment
|
||||
|
||||
SYNOPSYS
|
||||
|
||||
harmony-ve-vm [GLOBAL_OPTIONS] COMMAND [OPTIONS]
|
||||
|
||||
harmony-ve-vm list
|
||||
harmony-ve-vm create
|
||||
harmony-ve-vm start
|
||||
harmony-ve-vm stop
|
||||
harmony-ve-vm login
|
||||
|
||||
EOM
|
||||
|
||||
}
|
||||
|
||||
_extra_help(){
|
||||
|
||||
cat <<-EOM
|
||||
|
||||
GLOBAL_OPTIONS
|
||||
|
||||
-d Debug mode.
|
||||
|
||||
WARNINGS
|
||||
|
||||
This script is experimetal. Use with caution.
|
||||
EOM
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Implement functions
|
||||
|
||||
case "${1:-}" in
|
||||
|
||||
"")
|
||||
_short_help
|
||||
;;
|
||||
-h|--help)
|
||||
_short_help
|
||||
_extra_help
|
||||
;;
|
||||
# Commands entrypoints
|
||||
*)
|
||||
_warn "Unknown COMMAND '$1'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
)
|
||||
|
||||
|
||||
[ "$0" != "${BASH_SOURCE}" ] || harmony-ve-vm "${@}"
|
||||
|
||||
Reference in New Issue
Block a user