Corrections to consul discovery

This commit is contained in:
Eric Renfro 2023-12-13 13:11:21 -05:00
parent a8585a6d92
commit d6d52d2ea2
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -5,8 +5,6 @@ consulDir="/var/backups/consul"
scriptDir="$(dirname "$0")"
readConfig() {
local $config
if [[ -r "${scriptDir}/../config/consul_backup.cfg" ]]; then
source "${scriptDir}/../config/consul_backup.cfg"
fi
@ -28,12 +26,12 @@ check() {
return 3
fi
else
if ! which consul; then
if ! which consul &>/dev/null; then
echo "Cannot find Consul in PATH"
return 2
fi
if [[ -x "$(which consul)" ]]; then
CONSUL_PATH="$(basename 'which consul')"
CONSUL_PATH="$(basename "$(which consul)")"
echo "Found Consul in $CONSUL_PATH"
else
echo "FATAL: Cannot execute Consul"