mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
if sshpass fails, run normal ssh. check for dialog
This commit is contained in:
parent
94c0e8f6ba
commit
d29894b4ee
11
library.sh
11
library.sh
@ -58,7 +58,14 @@ function ssh_pi()
|
||||
-o ConnectTimeout=20\
|
||||
-o LogLevel=quiet )
|
||||
type sshpass &>/dev/null && local SSHPASS=( sshpass -p$PIPASS )
|
||||
${SSHPASS[@]} ${SSH[@]} ${PIUSER}@$IP $ARGS
|
||||
if [[ "${SSHPASS[@]}" == "" ]]; then
|
||||
${SSH[@]} ${PIUSER}@$IP $ARGS;
|
||||
else
|
||||
${SSHPASS[@]} ${SSH[@]} ${PIUSER}@$IP $ARGS
|
||||
local RET=$?
|
||||
[[ $RET -eq 5 ]] && { ${SSH[@]} ${PIUSER}@$IP $ARGS; return $?; }
|
||||
return $RET
|
||||
fi
|
||||
}
|
||||
|
||||
function wait_SSH()
|
||||
@ -87,6 +94,8 @@ function config()
|
||||
local INSTALL_SCRIPT="$1"
|
||||
local BACKTITLE="NextCloudPi installer configuration"
|
||||
|
||||
type dialog &>/dev/null || { echo "please, install dialog for interactive configuration"; return 1; }
|
||||
|
||||
test -f "$INSTALL_SCRIPT" || { echo "file "$INSTALL_SCRIPT" not found"; return 1; }
|
||||
local VARS=( $( grep "^[[:alpha:]]\+_=" "$INSTALL_SCRIPT" | cut -d= -f1 | sed 's|_$||' ) )
|
||||
local VALS=( $( grep "^[[:alpha:]]\+_=" "$INSTALL_SCRIPT" | cut -d= -f2 ) )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user