Skip to content

Instantly share code, notes, and snippets.

@tanelmae
Created March 15, 2019 07:20
Show Gist options
  • Save tanelmae/a949899c323ed8ae61b05fce23866c5a to your computer and use it in GitHub Desktop.
Save tanelmae/a949899c323ed8ae61b05fce23866c5a to your computer and use it in GitHub Desktop.
kubemci wrapper
#!/usr/bin/env bash
if [[ $OSTYPE == "darwin"* ]]; then
KMCI_LINK="https://storage.googleapis.com/kubemci-release/release/latest/bin/darwin/amd64/kubemci"
else
KMCI_LINK="https://storage.googleapis.com/kubemci-release/release/latest/bin/linux/amd64/kubemci"
fi
LOCAL_BIN=$(pwd)/bin
if [ "${1}" == "install" ]; then
[ -f ${LOCAL_BIN}/kubemci ] && rm ${LOCAL_BIN}/kubemci
shift
fi
if ! command -v kubemci > /dev/null 2>&1; then
if [ ! -f ${LOCAL_BIN}/kubemci ]; then
mkdir -p ${LOCAL_BIN}
echo "installing kubemci to ${LOCAL_BIN} dir"
curl $KMCI_LINK --output ${LOCAL_BIN}/kubemci --progress-bar &&
chmod +x ${LOCAL_BIN}/kubemci
fi
export PATH="${LOCAL_BIN}:${PATH}"
fi
kubemci $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment