run-builder: argument checking
Check we have at least one positional argument, and it is either "start", "stop" or "fg".
This commit is contained in:
parent
928d2278be
commit
dd2d3cf0a9
1 changed files with 12 additions and 0 deletions
|
|
@ -37,6 +37,18 @@ builder_stop() {
|
|||
${CONTAINER_RUNTIME} stop org.osbuild.koji.builder || true
|
||||
}
|
||||
|
||||
# check arguments
|
||||
if [[ $# -ne 1 || ( "$1" != "start" && "$1" != "stop" && "$1" != "fg") ]]; then
|
||||
cat <<DOC
|
||||
usage: $0 start|stop|fg
|
||||
|
||||
start - starts the builder container (background)
|
||||
fg - start the builder container in the foreground
|
||||
stop - stops and removes the builder container
|
||||
DOC
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# default to running in the background
|
||||
CONTAINER_FLAGS=-d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue