mirror of https://github.com/BlackLight/vmctl.git
32 lines
553 B
Plaintext
32 lines
553 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
function usage() {
|
||
|
actions=$(find "$srcdir/actions" -maxdepth 1 -name '*.sh' | xargs basename | cut -d. -f1)
|
||
|
cat <<EOF
|
||
|
Usage: $(basename "$0") <action>
|
||
|
|
||
|
Run $(basename "$0") <action> --help for more details.
|
||
|
Available actions:
|
||
|
|
||
|
$actions
|
||
|
EOF
|
||
|
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
if [ -L "$0" ]; then
|
||
|
export srcdir="$(dirname "$(readlink -f "$0")")"
|
||
|
else
|
||
|
export srcdir="$(cd "$(dirname "$0")" && pwd)"
|
||
|
fi
|
||
|
|
||
|
source "$srcdir/helpers/common.sh"
|
||
|
action=$1
|
||
|
shift
|
||
|
|
||
|
case "$action" in
|
||
|
install) source "$srcdir/actions/install.sh";;
|
||
|
*) usage;;
|
||
|
esac
|
||
|
|