nutools/lib/nulib/ssh-wrapper/rsync

23 lines
742 B
Plaintext
Raw Normal View History

2018-04-26 23:19:17 +04:00
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# wrapper permettant d'utiliser GIT_SSH avec des outils comme git-annex
# La variable NULIB_GIT_FORCE_PATH doit être définie: c'est la valeur de PATH à
# utiliser.
args=()
if [ -n "$NULIB_GIT_FORCE_SSH" ]; then
# corriger la valeur de l'argument -e s'il existe
while [ $# -gt 0 ]; do
if [ "$1" == -e ]; then
args=("${args[@]}" -e "$NULIB_GIT_FORCE_SSH ${2#* }")
shift; shift
break
fi
args=("${args[@]}" "$1")
shift
done
fi
args=("${args[@]}" "$@")
[ -n "$NULIB_GIT_FORCE_PATH" ] && export PATH="$NULIB_GIT_FORCE_PATH"
export NULIB_SSH_RSYNC_SUPPORT=1
exec rsync "${args[@]}"