chg: [sh] moved depenency check to seperate file

pull/23/head
Steve Clement 2021-01-20 03:35:27 +00:00
parent c9bdb8e78d
commit 906f0ee80e
2 changed files with 20 additions and 18 deletions

19
checkDeps.sh Normal file
View File

@ -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

View File

@ -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')