Merge branch 'ssh_user_opt_fix' of https://github.com/onovy/osync into onovy-ssh_user_opt_fix

Conflicts:
	osync.sh
This commit is contained in:
deajan 2015-06-26 16:44:24 +02:00
commit dd37cf062e
1 changed files with 13 additions and 8 deletions

View File

@ -4,7 +4,11 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.00pre PROGRAM_VERSION=1.00pre
<<<<<<< HEAD
PROGRAM_BUILD=1805201501 PROGRAM_BUILD=1805201501
=======
PROGRAM_BUILD=2104201501
>>>>>>> 6830127f95bb6498185f5d2ed9d6328e258e3036
## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode ## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode
if ! type -p "$BASH" > /dev/null if ! type -p "$BASH" > /dev/null
@ -1741,14 +1745,15 @@ function Init
# remove leadng 'ssh://' # remove leadng 'ssh://'
uri=${SLAVE_SYNC_DIR#ssh://*} uri=${SLAVE_SYNC_DIR#ssh://*}
# remove everything after '@' if [[ $uri == *@* ]]
_first_part=${uri%@*} then
REMOTE_USER=${_first_part%;*} # remove everything after '@'
if [ "$REMOTE_USER" == "" ] _first_part=${uri%@*}
then REMOTE_USER=${_first_part%;*}
REMOTE_USER=$(id -un) else
fi REMOTE_USER=$LOCAL_USER
#fingerprint=${_first_part#*fingerprint=} fi
if [ "$SSH_RSA_PRIVATE_KEY" == "" ] if [ "$SSH_RSA_PRIVATE_KEY" == "" ]
then then
SSH_RSA_PRIVATE_KEY=~/.ssh/id_rsa SSH_RSA_PRIVATE_KEY=~/.ssh/id_rsa