generated from me/template-mit
Add comments and TBD's.
This commit is contained in:
@@ -3,15 +3,30 @@
|
|||||||
# TBD:
|
# TBD:
|
||||||
# - ensure all SERVER_* variables actually exist in environment
|
# - ensure all SERVER_* variables actually exist in environment
|
||||||
# - test the script :)
|
# - test the script :)
|
||||||
|
# - add parameter to set loop=true
|
||||||
|
|
||||||
|
## Variables ##
|
||||||
|
|
||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
|
loop=false
|
||||||
|
|
||||||
|
## Validations ##
|
||||||
|
|
||||||
if [[ "$DIR" != *"MASTER" ]]; then
|
if [[ "$DIR" != *"MASTER" ]]; then
|
||||||
echo "This directory is not labeled as a MASTER. Skipping upload."
|
echo "This directory is not labeled as a MASTER. Skipping upload."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Main ##
|
||||||
|
|
||||||
new_dir="`basename $DIR`"
|
new_dir="`basename $DIR`"
|
||||||
new_dir="${new_dir//MASTER/clone}"
|
new_dir="${new_dir//MASTER/clone}"
|
||||||
|
|
||||||
|
do
|
||||||
clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir
|
clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir
|
||||||
|
while $loop
|
||||||
|
|
||||||
|
## Complete ##
|
||||||
|
|
||||||
|
echo "Done!"
|
||||||
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user