Skip to content

Commit

Permalink
Skip downloading onessl if already installed (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Mar 28, 2018
1 parent afb1746 commit aca5287
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hack/deploy/stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ echo "checking kubeconfig context"
kubectl config current-context || { echo "Set a context (kubectl use-context <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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aca5287

Please sign in to comment.