Skip to content

Commit

Permalink
Extend the ssh configuration check by calling the echo command if the…
Browse files Browse the repository at this point in the history
… first check fails.

Signed-off-by: Florian Wallner <[email protected]>
Signed-off-by: nachoparker <[email protected]>
  • Loading branch information
Florian Wallner authored and nachoparker committed Dec 31, 2019
1 parent 13e4208 commit 953c47a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/ncp/BACKUPS/nc-rsync-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[v1.20.1](https://github.com/nextcloud/nextcloudpi/commit/5fb675b) (2019-12-19) Revert "build: dont use empty values by default"
[v1.20.2](https://github.com/nextcloud/nextcloudpi/commit/97cb2ff) (2019-11-13) Extend the ssh configuration check by calling the echo command if the first check fails.

[v1.20.1](https://github.com/nextcloud/nextcloudpi/commit/6d0bc6b) (2019-12-19) Revert "build: dont use empty values by default"

[v1.20.0 ](https://github.com/nextcloud/nextcloudpi/commit/f75c415) (2019-12-19) upgrade to NC17.0.2

Expand Down

0 comments on commit 953c47a

Please sign in to comment.