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