allow create remote dir if not exist

This commit is contained in:
Nguyen Huu Thuong
2020-06-12 12:02:54 +02:00
parent d5cab73cf1
commit 469e512c9d

View File

@@ -25,7 +25,7 @@ check_remote_dir() {
local REMOTE=$2 local REMOTE=$2
CMD="ssh" CMD="ssh"
if $USEPASS; then if $USEPASS; then
CMD="sshpass -p $INPUT_PASS scp" CMD="sshpass -p $INPUT_PASS ssh"
fi fi
echo "Checking remote directory: '$REMOTE'" echo "Checking remote directory: '$REMOTE'"
if $CMD -o StrictHostKeyChecking=no -o ConnectTimeout=${INPUT_CONNECT_TIMEOUT:-30s} -p "${INPUT_PORT:-22}" "$INPUT_USER"@"$INPUT_HOST" "[ ! -d $REMOTE ]"; then if $CMD -o StrictHostKeyChecking=no -o ConnectTimeout=${INPUT_CONNECT_TIMEOUT:-30s} -p "${INPUT_PORT:-22}" "$INPUT_USER"@"$INPUT_HOST" "[ ! -d $REMOTE ]"; then