Browse Source

Make file deletion with ftp use the correct port.

Score 1 for the tests.
pull/841/head
Timothe Litt 2 years ago
parent
commit
d57ca78474
Failed to extract signature
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      getssl

+ 6
- 7
getssl View File

@ -1608,22 +1608,21 @@ for d in "${alldomains[@]}"; do
# shellcheck disable=SC2086
curl ${_NOMETER} -u "${davsuser}:${davspass}" -X "DELETE" "https://${davshost}:${davsport}${davsdirn}${davsfile}"
elif [[ "${t_loc:0:6}" == "ftpes:" ]] || [[ "${t_loc:0:5}" == "ftps:" ]] ; then
if [ -n "$FTP_PORT" ]; then SFTP_PORT=":${FTP_PORT}"; fi
# FTPES (FTP over explicit TLS/SSL, port 21) and FTPS (FTP over implicit TLS/SSL, port 990).
debug "using ftp to delete the file from $from"
ftpuser=$(echo "${t_loc}"| awk -F: '{print $2}')
ftppass=$(echo "${t_loc}"| awk -F: '{print $3}')
ftphost=$(echo "${t_loc}"| awk -F: '{print $4}')
ftplocn=$(echo "${t_loc}"| awk -F: '{print $5}')
SFTP_PORT=""
if [ -z "$FTP_PORT" ]; then
SFTP_PORT=":990"
fi
if [ -n "$FTP_PORT" ]; then SFTP_PORT=":${FTP_PORT}"; else SFTP_PORT=""; fi
debug "ftp user=$ftpuser - pass=$ftppass - host=$ftphost file=${ftplocn}/${token:?}"
if [[ "${to:0:5}" == "ftps:" ]] ; then
# shellcheck disable=SC2086
[ -z "$FTP_PORT" ] && SFTP_PORT=":990"
# shellcheck disable=SC2086
curl ${_NOMETER} $FTPS_OPTIONS --ftp-ssl --ftp-ssl-reqd -u "${ftpuser}:${ftppass}" --silent -Q "DELE ${token:?}}" "ftp://${ftphost}${SFTP_PORT}/${ftplocn}/"
else
# shellcheck disable=SC2086
# shellcheck disable=SC2086
curl ${_NOMETER} $FTPS_OPTIONS --ftp-ssl --ftp-ssl-reqd -u "${ftpuser}:${ftppass}" --silent -Q "DELE ${token:?}" "ftp://${ftphost}${SFTP_PORT}/${ftplocn}/"
fi
else


Loading…
Cancel
Save