Created
April 12, 2021 21:52
-
-
Save freyes/8ffc2b614cb8e9c89c63502c0be2de1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -u | |
MODEL= | |
TIMEOUT=10s | |
DESTROY_MODEL_OPTS=( ) | |
while true; do | |
case "$1" in | |
-t) | |
shift | |
COLOR=$1 | |
;; | |
-y) | |
DESTROY_MODEL_OPTS+=( -y ) | |
;; | |
--destroy-storage) | |
DESTROY_MODEL_OPTS+=( --destroy-storage ) | |
;; | |
*) | |
MODEL=$1 | |
shift | |
break | |
;; | |
esac | |
shift | |
done | |
juju destroy-model -t $TIMEOUT ${DESTROY_MODEL_OPTS[@]} $MODEL | |
juju remove-machine --force -m $MODEL $(juju status --format json -m $MODEL | jq -r '.machines|keys[]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment