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")"
|
scriptDir="$(dirname "$0")"
|
||||||
|
|
||||||
readConfig() {
|
readConfig() {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
|
@ -41,6 +41,7 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
hook_before() {
|
hook_before() {
|
||||||
|
readConfig
|
||||||
check || exit $?
|
check || exit $?
|
||||||
${CONSUL_PATH}/consul snapshot save "$consulDir/consul.snap"
|
${CONSUL_PATH}/consul snapshot save "$consulDir/consul.snap"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue