From ad9b844dca04e612b31bbf16b231149b86b09e3a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 13 Aug 2020 19:03:54 +0200 Subject: put: moar escaping --- etc/functions/put | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/functions/put b/etc/functions/put index 300be7b..6e4069c 100644 --- a/etc/functions/put +++ b/etc/functions/put @@ -98,8 +98,11 @@ while (( ${#hosts} )) { } lftp -c "connect sftp://${ssh_name}; cd ${target_dir}; put '${file}'"\ " -o '${remote_file}'; chmod 644 '${remote_file}'" - if $(curl -fI ${server_prefix}${remote_file// /%20} &> /dev/null); then - echo ${server_prefix}${remote_file// /%20} + remote_file=${remote_file// /%20} + remote_file=${remote_file//\#/%23} + url=${server_prefix}${remote_file} + if $(curl -fI ${server_prefix}${remote_file} &> /dev/null); then + echo ${server_prefix}${remote_file} return 0 fi } -- cgit v1.2.3