generated from me/template-mit
Change command to use the proper variables which should now exist in each main env project. Add a sleep for the loop with conditional output.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# TBD:
|
||||
# - ensure all SERVER_* variables actually exist in environment
|
||||
# - test the script :)
|
||||
# - add parameter to set loop=true
|
||||
# - allow passing the script a variable for the dir, rather than assuming curr
|
||||
@@ -23,8 +22,15 @@ fi
|
||||
new_dir="`basename $DIR`"
|
||||
new_dir="${new_dir//MASTER/clone}"
|
||||
|
||||
sleep=0
|
||||
do
|
||||
clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir
|
||||
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 ##
|
||||
|
||||
Reference in New Issue
Block a user