You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
581 B

#!/usr/bin/env bash
# CONSTANTS
BASEDIR=$(dirname "$0")
CONTAINERS=()
USER=
# FUNCTIONS
function usage {
echo "$(basename "$0") <CONTAINER_NAME>..."
}
function parse_options {
while [[ $# -gt 0 ]]; do
case "$1" in
--help | -h)
usage && exit 0
;;
-*)
echo >&2 "Error: unknown option: $1" && usage && exit 2
;;
*)
CONTAINERS+=("$1")
;;
esac
shift 1 # Move to the next argument
done
[[ ${#CONTAINERS[@]} == 0 ]] && usage && exit 1 || true
}
function start {
incus start "${CONTAINERS[@]}"
}
# MAIN
set -Eue
parse_options $*
start