[DO-458] fix conditional for consul backup script (!3)
Reviewed-on: https://git.avroid.tech/DevOps/avroid_scripts/pulls/3 Reviewed-by: Boris Shestov <boris.shestov@avroid.tech> Reviewed-by: Denis Patrakeev <denis.patrakeev@avroid.tech> Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech> Co-committed-by: Rustam Tagaev <rustam.tagaev@avroid.tech>
This commit is contained in:
committed by
Denis Patrakeev
parent
85c77deb98
commit
f07b54ea36
@@ -8,6 +8,6 @@ HOSTNAME=$(hostname)
|
|||||||
|
|
||||||
LEADER=$(consul operator raft list-peers | grep leader | cut -f 1 -d " ")
|
LEADER=$(consul operator raft list-peers | grep leader | cut -f 1 -d " ")
|
||||||
|
|
||||||
[ "$LEADER" = "consul-vault-01" ] \
|
[ "$LEADER" = "${HOSTNAME}" ] \
|
||||||
&& (echo "I'm leader" && echo "Create backup" && consul snapshot save "${BACKUP_DIR_PATH}/${BACKUP_FILE}" ) \
|
&& (echo "I'm leader" && echo "Create backup" && consul snapshot save "${BACKUP_DIR_PATH}/${BACKUP_FILE}" ) \
|
||||||
|| echo "I'm not leader"
|
|| echo "I'm not leader"
|
||||||
|
|||||||
Reference in New Issue
Block a user