From def924c717d086c89a10d3700a947a14e6e16ed7 Mon Sep 17 00:00:00 2001 From: Timothe Litt Date: Sat, 16 Mar 2024 05:51:13 -0400 Subject: [PATCH] Add code for deleteing ftps tokens --- getssl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/getssl b/getssl index d3d8059..41ccf79 100755 --- a/getssl +++ b/getssl @@ -1548,6 +1548,20 @@ for d in "${alldomains[@]}"; do cd $ftplocn delete ${token:?} EOF + elif [[ "${t_loc:0:6}" == "ftpes:" ]] || [[ "${t_loc:0:5}" == "ftps:" ]] ; then + 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}') + debug "ftp user=$ftpuser - pass=$ftppass - host=$ftphost file=${ftplocnn/${token:?}" + if [[ "${to:0:5}" == "ftps:" ]] ; then + # shellcheck disable=SC2086 + curl ${_NOMETER} $FTPS_OPTIONS --ftp-ssl --ftp-ssl-reqd -u "${ftpuser}:${ftppass}" --silent -Q "DELE ${token:?}}" "ftp://${ftphost}${ftplocn}:990/" + else + # shellcheck disable=SC2086 + curl ${_NOMETER} $FTPS_OPTIONS --ftp-ssl --ftp-ssl-reqd -u "${ftpuser}:${ftppass}" --silent -Q "DELE ${token:?}" "ftp://${ftphost}${ftplocn}/" + fi else rm -f "${t_loc:?}/${token:?}" fi