diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ncp/BACKUPS/nc-rsync-auto.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/ncp/BACKUPS/nc-rsync-auto.sh b/bin/ncp/BACKUPS/nc-rsync-auto.sh index 9e45f583..ed2510a1 100644 --- a/bin/ncp/BACKUPS/nc-rsync-auto.sh +++ b/bin/ncp/BACKUPS/nc-rsync-auto.sh @@ -28,10 +28,12 @@ configure() return 1; } + # Check if the ssh access is properly configured. For this purpose the command : or echo is called remotely. + # If one of the commands works, the test is successful. [[ "$DESTINATION" =~ : ]] && { local NET="$( sed 's|:.*||' <<<"$DESTINATION" )" local SSH=( ssh -o "BatchMode=yes" -p "$PORTNUMBER" "$NET" ) - ${SSH[@]} : || { echo "SSH non-interactive not properly configured"; return 1; } + ${SSH[@]} echo || { echo "SSH non-interactive not properly configured"; return 1; } } echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto |