diff --git a/bin/pbin b/bin/pbin index f9d632b..93b10be 100755 --- a/bin/pbin +++ b/bin/pbin @@ -2,4 +2,4 @@ f="${1}" uuid="$(uuidgen -t)" -upload "${f}" "${uuid}/${f}" "pastes" +upload "${f}" "${uuid}/$(basename "$f")" "pastes" diff --git a/bin/upload b/bin/upload index afc679a..404751b 100755 --- a/bin/upload +++ b/bin/upload @@ -18,7 +18,7 @@ if [ "$(curl -s -o /dev/null -w "%{http_code}" "${url}")" -eq 200 ]; then exit 3 fi -ssh "$HOST" mkdir -p "${internal_dir}" +ssh "$HOST" mkdir -p "$(dirname "${internal_dir}/${fname}")" rsync --progress --no-owner --no-group --chmod=644 --ignore-existing "${f}" "${HOST}:${internal_dir}/${fname}" | tee "${HOME}/.upload.log" code="$?" echo "Uploaded to: ${url}"