From ce28408f1453327995cbf398f6e96859e861230b Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Mon, 9 Oct 2023 11:52:55 -0700 Subject: [PATCH] Interate on docker-stacks.sh --- fighter/scripts/docker-stacks.sh | 40 +++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/fighter/scripts/docker-stacks.sh b/fighter/scripts/docker-stacks.sh index 5692eb6..6e372c7 100644 --- a/fighter/scripts/docker-stacks.sh +++ b/fighter/scripts/docker-stacks.sh @@ -49,9 +49,6 @@ function main { -l | --lint) LINT=true ;; - -f | --force) - FORCE=true - ;; *) OPERATION="$OPERATION $1" ;; @@ -59,14 +56,45 @@ function main { shift done case $OPERATION in - up) + up*) echo "OPERATION is up" + while [ $# -gt 0 ]; do + case $1 in + -f | --force) + FORCE=true + ;; + up) + true + ;; + *) + echo "Unrecognized operation \'$1\'" + exit + ;; + esac + shift + done + echo "FORCE is $FORCE" ;; - down) + down*) echo "OPERATION is down" + # run "down" on all stacks + while [ $# -gt 0 ]; do + case $1 in + down) + true + ;; + *) + echo "Unrecognized operation \'$1\'" + exit + ;; + esac + shift + done + echo "FORCE is $FORCE" ;; *) - echo "OPERATION is not up or down" + echo "Operation not recognized." + exit ;; esac