diff --git a/checkDeps.sh b/checkDeps.sh new file mode 100644 index 0000000..4c9447a --- /dev/null +++ b/checkDeps.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +GOT_PACKER=$(which packer > /dev/null 2>&1; echo $?) +if [[ "${GOT_PACKER}" == 0 ]]; then + echo "Packer detected, version: $(packer -v)" + PACKER_RUN=$(which packer) +else + echo "No packer binary detected, please make sure you installed it from: https://www.packer.io/downloads.html" + exit 1 +fi + +GOT_RHASH=$(which rhash > /dev/null 2>&1; echo $?) +if [[ "${GOT_RHASH}" == 0 ]]; then + echo "rhash detected, version: $(rhash --version)" + RHASH_RUN=$(which rhash) +else + echo "No rhash binary detected, please make sure you installed it." + exit 1 +fi diff --git a/deploy.sh b/deploy.sh index b352e19..8ea4680 100755 --- a/deploy.sh +++ b/deploy.sh @@ -14,24 +14,7 @@ source config.sh ### ---- NO TOUCHY BEYOND THIS POINT, PLEASE --- ### -# TODO: Move into seprate file -GOT_PACKER=$(which packer > /dev/null 2>&1; echo $?) -if [[ "${GOT_PACKER}" == 0 ]]; then - echo "Packer detected, version: $(packer -v)" - PACKER_RUN=$(which packer) -else - echo "No packer binary detected, please make sure you installed it from: https://www.packer.io/downloads.html" - exit 1 -fi - -GOT_RHASH=$(which rhash > /dev/null 2>&1; echo $?) -if [[ "${GOT_RHASH}" == 0 ]]; then - echo "rhash detected, version: $(rhash --version)" - RHASH_RUN=$(which rhash) -else - echo "No rhash binary detected, please make sure you installed it." - exit 1 -fi +source checkDeps.sh # Latest version of misp VER=$(curl -s https://api.github.com/repos/${REPO}/tags |jq -r '.[0] | .name')