Extend the ssh configuration check by calling the echo command if the first check fails.

Signed-off-by: Florian Wallner <florian.wallner@exxcellent.de>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
Florian Wallner 2019-11-13 16:07:55 +01:00 committed by nachoparker
parent 13e4208d87
commit 953c47a0e5
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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