Files
env-shared/bin-shared/send_master.sh
2026-03-28 13:29:34 -07:00

45 lines
909 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 ##
PROG="$(basename -- "${BASH_SOURCE[0]}")"
loop=false
DIR="`pwd`"
dir="`basename $DIR`"
## Validations ##
if [[ "$DIR" != *"MASTER" ]]; then
echo "'$DIR' is not labeled as a MASTER. Skipping upload."
exit 0
fi
## Main ##
new_dir="${dir//MASTER/clone}"
sleep=0
while true; 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
if [[ "$loop" == false ]]; then
break;
fi
done
## Complete ##
echo "Done!"
exit 0