mirror of
https://github.com/deajan/obackup.git
synced 2025-05-11 20:53:40 +02:00
Added ignore known hosts option to obackup
This commit is contained in:
parent
7eeff3b476
commit
b9d2b72ac9
@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
|
|||||||
PROGRAM_BUILD=2016031801
|
PROGRAM_BUILD=2016031801
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
## FUNC_BUILD=2016032202
|
## FUNC_BUILD=2016032501
|
||||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||||
|
|
||||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||||
@ -872,6 +872,11 @@ function PreInit {
|
|||||||
SSH_COMP=
|
SSH_COMP=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Ignore SSH known host verification
|
||||||
|
if [ "$SSH_IGNORE_KNOWN_HOSTS" == "yes" ]; then
|
||||||
|
SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||||
|
fi
|
||||||
|
|
||||||
## Support for older config files without RSYNC_EXECUTABLE option
|
## Support for older config files without RSYNC_EXECUTABLE option
|
||||||
if [ "$RSYNC_EXECUTABLE" == "" ]; then
|
if [ "$RSYNC_EXECUTABLE" == "" ]; then
|
||||||
RSYNC_EXECUTABLE=rsync
|
RSYNC_EXECUTABLE=rsync
|
||||||
@ -973,7 +978,7 @@ function PostInit {
|
|||||||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||||
|
|
||||||
# Define remote commands
|
# Define remote commands
|
||||||
SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY $REMOTE_USER@$REMOTE_HOST -p $REMOTE_PORT"
|
SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY $SSH_IGNORE_KNOWN_HOSTS $REMOTE_USER@$REMOTE_HOST -p $REMOTE_PORT"
|
||||||
SCP_CMD="$(type -p scp) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -P $REMOTE_PORT"
|
SCP_CMD="$(type -p scp) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -P $REMOTE_PORT"
|
||||||
RSYNC_SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT"
|
RSYNC_SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
###### Local / Remote backup script for files & databases
|
###### Local / Remote backup script for files & databases
|
||||||
###### (L) 2013-2015 by Ozy de Jong (www.netpower.fr)
|
###### (L) 2013-2015 by Ozy de Jong (www.netpower.fr)
|
||||||
###### obackup v2.x config file rev 2015111801
|
###### obackup v2.x config file rev 2016032501
|
||||||
|
|
||||||
###### GENERAL BACKUP OPTIONS
|
###### GENERAL BACKUP OPTIONS
|
||||||
|
|
||||||
@ -56,6 +56,9 @@ SSH_RSA_PRIVATE_KEY="/root/.ssh/id_rsa"
|
|||||||
## ssh compression should be used unless your remote connection is good enough (LAN)
|
## ssh compression should be used unless your remote connection is good enough (LAN)
|
||||||
SSH_COMPRESSION=yes
|
SSH_COMPRESSION=yes
|
||||||
|
|
||||||
|
## Ignore ssh known hosts verification. DANGER WILL ROBINSON DANGER: This can lead to security risks. Only enable if you know what you're doing.
|
||||||
|
SSH_IGNORE_KNOWN_HOSTS=no
|
||||||
|
|
||||||
## Remote rsync executable path. Leave this empty in most cases
|
## Remote rsync executable path. Leave this empty in most cases
|
||||||
RSYNC_REMOTE_PATH=""
|
RSYNC_REMOTE_PATH=""
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
|
|||||||
PROGRAM_BUILD=2016031801
|
PROGRAM_BUILD=2016031801
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
## FUNC_BUILD=2016032202
|
## FUNC_BUILD=2016032501
|
||||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||||
|
|
||||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||||
@ -803,6 +803,11 @@ function PreInit {
|
|||||||
SSH_COMP=
|
SSH_COMP=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Ignore SSH known host verification
|
||||||
|
if [ "$SSH_IGNORE_KNOWN_HOSTS" == "yes" ]; then
|
||||||
|
SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||||
|
fi
|
||||||
|
|
||||||
## Support for older config files without RSYNC_EXECUTABLE option
|
## Support for older config files without RSYNC_EXECUTABLE option
|
||||||
if [ "$RSYNC_EXECUTABLE" == "" ]; then
|
if [ "$RSYNC_EXECUTABLE" == "" ]; then
|
||||||
RSYNC_EXECUTABLE=rsync
|
RSYNC_EXECUTABLE=rsync
|
||||||
@ -903,7 +908,7 @@ function PreInit {
|
|||||||
function PostInit {
|
function PostInit {
|
||||||
|
|
||||||
# Define remote commands
|
# Define remote commands
|
||||||
SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY $REMOTE_USER@$REMOTE_HOST -p $REMOTE_PORT"
|
SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY $SSH_IGNORE_KNOWN_HOSTS $REMOTE_USER@$REMOTE_HOST -p $REMOTE_PORT"
|
||||||
SCP_CMD="$(type -p scp) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -P $REMOTE_PORT"
|
SCP_CMD="$(type -p scp) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -P $REMOTE_PORT"
|
||||||
RSYNC_SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT"
|
RSYNC_SSH_CMD="$(type -p ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY -p $REMOTE_PORT"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user