Add PLUGIN_FTP_USERNAME & PLUGIN_FTP_PASSWORD
This commit is contained in:
parent
7f20f9eb2c
commit
db24bc0bdd
10
upload.sh
10
upload.sh
@ -1,10 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$FTP_USERNAME" ]; then
|
||||
if [[ -z "$FTP_USERNAME" && -z "$PLUGIN_FTP_USERNAME" ]]; then
|
||||
echo "Need to set username"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FTP_USERNAME_STR=""
|
||||
FTP_PASSWORD_STR=""
|
||||
|
||||
[ -n "$PLUGIN_FTP_USERNAME" ] && FTP_USERNAME_STR="$PLUGIN_FTP_USERNAME" || FTP_USERNAME_STR="$FTP_USERNAME"
|
||||
[ -n "$PLUGIN_FTP_PASSWORD" ] && FTP_PASSWORD_STR="$PLUGIN_FTP_PASSWORD" || FTP_PASSWORD_STR="$FTP_PASSWORD"
|
||||
|
||||
if [ -z "$PLUGIN_HOSTNAME" ]; then
|
||||
echo "Need to set hostname"
|
||||
exit 1
|
||||
@ -84,4 +90,4 @@ lftp $PLUGIN_DEBUG -e "set xfer:log 1; \
|
||||
$PLUGIN_CLEAN_DIR; \
|
||||
mirror --verbose $PLUGIN_CHMOD -R $PLUGIN_ONLY_NEWER $PLUGIN_MIRROR_OPTS $PLUGIN_INCLUDE_STR $PLUGIN_EXCLUDE_STR $(pwd)$PLUGIN_SRC_DIR $PLUGIN_DEST_DIR; \
|
||||
$PLUGIN_POST_ACTION;" \
|
||||
-u $FTP_USERNAME,$FTP_PASSWORD $PLUGIN_HOSTNAME
|
||||
-u "$FTP_USERNAME_STR","$FTP_PASSWORD_STR" "$PLUGIN_HOSTNAME"
|
||||
|
Loading…
Reference in New Issue
Block a user