mirror of
https://github.com/hackerschoice/segfault.git
synced 2024-06-30 18:51:22 +00:00
26 lines
654 B
Bash
Executable File
26 lines
654 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
## In the format of:
|
|
# HOSTS+=("adm")
|
|
# HOSTS+=("lgm")
|
|
|
|
source .env_hosts || exit
|
|
|
|
# Reverse order so that first in HOSTS has master priority
|
|
i=${#HOSTS[@]}
|
|
while [[ $i -gt 0 ]]; do
|
|
((i--))
|
|
h="${HOSTS[$i]}"
|
|
echo "#${i} Syncing ${h} DOWN"
|
|
rsync -ral "${h}":/sf/config/db/banned "${h}":/sf/config/db/private "${h}":/sf/config/db/token "${h}":/sf/config/db/limits .
|
|
done
|
|
|
|
echo "==[DOWN done. Press Enter to start UP]=================================================="
|
|
read
|
|
i=0
|
|
for h in "${HOSTS[@]}"; do
|
|
echo "#$i Syncing ${h} UP"
|
|
rsync -ral banned private token limits "${h}":'/sf/config/db'
|
|
((i++))
|
|
done
|