generated from me/template-mit
42 lines
850 B
Bash
Executable File
42 lines
850 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
|
|
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
|