From 66dcaedfd0835c155a0cf0e307bd0d1f1d67d67b Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Tue, 6 Oct 2020 20:27:50 +0200 Subject: [PATCH] Add `stack` and `volume` as shortcuts to docker --- abra | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/abra b/abra index 80044ba..32440f1 100755 --- a/abra +++ b/abra @@ -192,6 +192,8 @@ sub_secret_insert() { PW=$3 if [ -z "$SECRET" ] || [ -z "$VERSION" ] || [ -z "$PW" ]; then + error "Required arguments missing" + echo echo "Usage: $PROGRAM_NAME secret insert SECRET VERSION PW" exit fi @@ -205,6 +207,13 @@ sub_secret_generate(){ VERSION=$2 PWGEN=${3:-pwqgen} + if [ -z "$SECRET" ] || [ -z "$VERSION" ]; then + error "Required arguments missing" + echo + echo "Usage: $PROGRAM_NAME secret generate SECRET VERSION [PW]" + exit + fi + PW=$($PWGEN) success "Password: $PW" @@ -431,6 +440,18 @@ sub_upgrade() { curl -fsSL https://install.abra.autonomic.zone | bash } +###### Docker alias subcommands + +sub_stack() { + # shellcheck disable=SC2068 + docker stack $@ +} + +sub_volume() { + # shellcheck disable=SC2068 + docker volume $@ +} + ###### Main SUBCOMMAND=$1