# HG changeset patch # User František Kučera # Date 1555791864 -7200 # Node ID 5454e8a0c53edf1778da6b4a4e112b0fb019541c # Parent 66728b983b4130c8f17090c7602eab900373a687 use variables in clientSubmitBackupRequest diff -r 66728b983b41 -r 5454e8a0c53e vcs-backup.sh --- a/vcs-backup.sh Sat Apr 20 22:17:38 2019 +0200 +++ b/vcs-backup.sh Sat Apr 20 22:24:24 2019 +0200 @@ -78,13 +78,14 @@ # $1 = VCS type: hg, git # $2 = URL # $3 = "public" or "private" (default), whether the repository should be available through the public web interface +# $4 = "clone" (optional), if present, will also clone the backup locally vcs_backup_public_clientSubmitBackupRequest() { if isValidTypeAndURL "$1" "$2"; then loadConfigFile ~/.config/vcs-backup/client.cfg ${VCS_BACKUP_SSH_COMMAND[@]} vcs-backup.sh serverSubmitBackupRequest "$1" "$2" "$3" "$4" if [[ "$4" == "clone" ]]; then - if [[ "$1" == "hg" ]]; then hg clone "ssh://${VCS_BACKUP_SERVER}//mnt/data/current/$1/$(urlToRelativeDirectoryPath $2)"; - elif [[ "$1" == "git" ]]; then git clone "ssh://${VCS_BACKUP_SERVER}//mnt/data/current/$1/$(urlToRelativeDirectoryPath $2)"; + if [[ "$1" == "hg" ]]; then hg clone "ssh://${VCS_BACKUP_SERVER}/$VCS_BACKUP_CURRENT_DIR/$1/$(urlToRelativeDirectoryPath $2)"; + elif [[ "$1" == "git" ]]; then git clone "ssh://${VCS_BACKUP_SERVER}/$VCS_BACKUP_CURRENT_DIR/$1/$(urlToRelativeDirectoryPath $2)"; fi fi else