Fixing consul script not reading config

This commit is contained in:
Eric Renfro 2023-12-15 10:35:49 -05:00
parent d914b2f2e7
commit ece493b83c
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -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"
}