Fixed up consul agent to completion

This commit is contained in:
Eric Renfro 2021-09-05 01:23:02 -04:00
parent becbb8137e
commit fcd51bdb03
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF

View file

@ -1,15 +1,27 @@
#!/bin/bash
restoreDir=/etc/restore
consulDir="$restoreDir/consul"
hook_check() {
:
if [[ -d "$consulDir" ]]; then
rm -rf "$consulDir" || exit 1
fi
}
hook_pre() {
consul snapshot save /etc/restore/consul.snap
hook_check
mkdir -p "$consulDir" || exit 1
pushd "$restoreDir" || exit 2
consul snapshot save "$consulDir/consul.snap"
popd || exit 2
}
hook_post() {
:
rm -rf "$consulDir" || exit 1
}
case "$1" in