Files
rsync/rsync-ssl
2020-06-07 19:25:18 -07:00

24 lines
557 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%/*}"
libdir="$mydir/../lib/rsync"
exec "$mydir/rsync" --rsh="$libdir/ssl-rsh" "${@}"