Files
env-shared/bin-shared/send_master.sh

40 lines
843 B
Bash
Executable File

#!/usr/bin/env bash
# TBD:
# - test the script :)
# - add parameter to set loop=true
# - allow passing the script a variable for the dir, rather than assuming curr
## Variables ##
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
loop=false
## Validations ##
if [[ "$DIR" != *"MASTER" ]]; then
echo "'$DIR' is not labeled as a MASTER. Skipping upload."
exit 0
fi
## Main ##
new_dir="`basename $DIR`"
new_dir="${new_dir//MASTER/clone}"
sleep=0
do
if (( $sleep > 0 )); then
echo "Sleeping for '$sleep' seconds..."
sleep $sleep
fi
#clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir
echo "FORTEST - Here's the command: 'clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'"
sleep=30
while $loop
## Complete ##
echo "Done!"
exit 0