23 lines
533 B
Bash
Executable File
23 lines
533 B
Bash
Executable File
#!/bin/bash
|
|
# This script supports using stunnel or openssl to secure an rsync daemon connection.
|
|
# The first option can be --type=stunnel or --type=openssl to choose your connection
|
|
# type (overriding any $RSYNC_SSL_TYPE default value).
|
|
|
|
if [[ "$1" == --type=* ]]; then
|
|
export RSYNC_SSL_TYPE="${1/--type=/}"
|
|
shift
|
|
fi
|
|
|
|
case "$@" in
|
|
*rsync://*) ;;
|
|
*::*) ;;
|
|
*)
|
|
echo "You must use rsync-ssl with a daemon-style hostname." 1>&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
mydir="${0%/*}"
|
|
|
|
exec "$mydir/rsync" --rsh="$mydir/rsync-ssl-rsh" "${@}"
|