Merge pull request #26 from Bouni/master

Add debug option, SSH auto confirm fingerprint
This commit is contained in:
Christoph Schlosser 2022-05-26 21:58:21 +02:00 committed by GitHub
commit 89b3d3d4ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -1,6 +1,7 @@
FROM alpine:edge
RUN apk --no-cache add \
openssh \
libressl \
lftp \
bash

View File

@ -30,6 +30,10 @@ environment:
PLUGIN_VERIFY: false
PLUGIN_EXCLUDE: (egrep like pattern matching)
PLUGIN_INCLUDE: (egrep like pattern matching)
PLUGIN_CHMOD: true | false (default true)
PLUGIN_CLEAN_DIR: true | false (default false)
PLUGIN_AUTO_CONFIRM: true | false (default false)
PLUGIN_DEBUG: true | false (default false)
```
## Full file example

View File

@ -38,6 +38,18 @@ else
PLUGIN_CLEAN_DIR=""
fi
if [ -z "$PLUGIN_DEBUG" ]; then
PLUGIN_DEBUG=""
else
PLUGIN_DEBUG="-d"
fi
if [ -n "$PLUGIN_AUTO_CONFIRM" ]; then
PLUGIN_AUTO_CONFIRM="true"
else
PLUGIN_AUTO_CONFIRM="false"
fi
PLUGIN_EXCLUDE_STR=""
PLUGIN_INCLUDE_STR=""
@ -50,10 +62,11 @@ for i in "${in_arr[@]}"; do
PLUGIN_INCLUDE_STR="$PLUGIN_INCLUDE_STR -i '$i'"
done
lftp -e "set xfer:log 1; \
lftp $PLUGIN_DEBUG -e "set xfer:log 1; \
set ftp:ssl-allow $PLUGIN_SECURE; \
set ftp:ssl-force $PLUGIN_SECURE; \
set ftp:ssl-protect-data $PLUGIN_SECURE; \
set sftp:auto-confirm $PLUGIN_AUTO_CONFIRM; \
set ssl:verify-certificate $PLUGIN_VERIFY; \
set ssl:check-hostname $PLUGIN_VERIFY; \
set net:max-retries 3; \