rs-backup-suite/server/usr/bin/rs-run-ssh-cmd

15 lines
341 B
Plaintext
Raw Normal View History

#!/bin/sh
2013-04-02 18:25:38 +00:00
home_dir=$1
if [ "${SSH_ORIGINAL_COMMAND}" == "internal-sftp" ] || [ "${SSH_ORIGINAL_COMMAND}" == "/usr/lib/ssh/sftp-server" ]; then
cd "${home_dir}/files"
exec /usr/lib/ssh/sftp-server -R
else
source /etc/profile
2014-09-15 13:23:13 +00:00
exec `which rsync` --server --daemon --config="${home_dir}/rsync.conf" .
2013-04-02 18:25:38 +00:00
fi
echo "Session failed." >&2
exit 1