Corrections to consul discovery
This commit is contained in:
parent
a8585a6d92
commit
d6d52d2ea2
1 changed files with 2 additions and 4 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue