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:
74
examples/opnsense/scripts/harmony-ve-network
Executable file
74
examples/opnsense/scripts/harmony-ve-network
Executable file
@@ -0,0 +1,74 @@
|
||||
|
||||
#! /bin/bash
|
||||
|
||||
harmony-ve-network()(
|
||||
|
||||
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-network
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Modify localhost network for Harmony Virtual Execution Environment
|
||||
SYNOPSYS
|
||||
|
||||
harmony-ve-network [GLOBAL_OPTIONS] COMMAND [OPTIONS]
|
||||
|
||||
harmony-ve-network check
|
||||
harmony-ve-network setup
|
||||
harmony-ve-network cleanup
|
||||
|
||||
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-network "${@}"
|
||||
|
||||
Reference in New Issue
Block a user