PR #16 fix.
This commit is contained in:
parent
0ea1a3e5de
commit
6830127f95
11
osync.sh
11
osync.sh
|
@ -4,7 +4,7 @@ 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
|
||||||
PROGRAM_BUILD=2004201501
|
PROGRAM_BUILD=2104201501
|
||||||
|
|
||||||
## 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
|
||||||
|
@ -1667,14 +1667,15 @@ function Init
|
||||||
|
|
||||||
# remove leadng 'ssh://'
|
# remove leadng 'ssh://'
|
||||||
uri=${SLAVE_SYNC_DIR#ssh://*}
|
uri=${SLAVE_SYNC_DIR#ssh://*}
|
||||||
|
if [[ $uri == *@* ]]
|
||||||
|
then
|
||||||
# remove everything after '@'
|
# remove everything after '@'
|
||||||
_first_part=${uri%@*}
|
_first_part=${uri%@*}
|
||||||
REMOTE_USER=${_first_part%;*}
|
REMOTE_USER=${_first_part%;*}
|
||||||
if [ "$REMOTE_USER" == "" ]
|
else
|
||||||
then
|
REMOTE_USER=$LOCAL_USER
|
||||||
REMOTE_USER=$(id -un)
|
|
||||||
fi
|
fi
|
||||||
#fingerprint=${_first_part#*fingerprint=}
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue