Fixing consul script not reading config
This commit is contained in:
parent
d914b2f2e7
commit
ece493b83c
1 changed files with 3 additions and 2 deletions
|
@ -5,9 +5,9 @@ consulDir="/var/backups/consul"
|
|||
scriptDir="$(dirname "$0")"
|
||||
|
||||
readConfig() {
|
||||
if [[ -r "${scriptDir}/../config/consul_backup.cfg" ]]; then
|
||||
if [[ -r "${scriptDir}/../config/consul_backup.cfg" ]]; then
|
||||
source "${scriptDir}/../config/consul_backup.cfg"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check() {
|
||||
|
@ -41,6 +41,7 @@ check() {
|
|||
}
|
||||
|
||||
hook_before() {
|
||||
readConfig
|
||||
check || exit $?
|
||||
${CONSUL_PATH}/consul snapshot save "$consulDir/consul.snap"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue