From aca528734224aa8aa00bccf5cffb391883d2cb38 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 27 Mar 2018 20:56:10 -0700 Subject: [PATCH] Skip downloading onessl if already installed (#401) --- hack/deploy/stash.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hack/deploy/stash.sh b/hack/deploy/stash.sh index bc04d07f8..ca24bf0cb 100755 --- a/hack/deploy/stash.sh +++ b/hack/deploy/stash.sh @@ -7,8 +7,14 @@ echo "checking kubeconfig context" kubectl config current-context || { echo "Set a context (kubectl use-context ) out of the following:"; echo; kubectl config get-contexts; exit 1; } echo "" +# http://redsymbol.net/articles/bash-exit-traps/ +function cleanup { + rm -rf $ONESSL ca.crt ca.key server.crt server.key +} +trap cleanup EXIT + # https://stackoverflow.com/a/677212/244009 -if [ -x "$(command -v onessl >/dev/null 2>&1)" ]; then +if [ -x "$(command -v onessl)" ]; then export ONESSL=onessl else # ref: https://stackoverflow.com/a/27776822/244009 @@ -36,12 +42,6 @@ else esac fi -# http://redsymbol.net/articles/bash-exit-traps/ -function cleanup { - rm -rf $ONESSL ca.crt ca.key server.crt server.key -} -trap cleanup EXIT - # ref: https://stackoverflow.com/a/7069755/244009 # ref: https://jonalmeida.com/posts/2013/05/26/different-ways-to-implement-flags-in-bash/ # ref: http://tldp.org/LDP/abs/html/comparison-ops.html