From 78b17aa23481a10aeff837bd4ee467fa08f0af8f Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 22 Jun 2015 02:44:11 +0300 Subject: [PATCH] actually return the proper url --- sup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sup b/sup index 154dd83..f061aa0 100755 --- a/sup +++ b/sup @@ -83,8 +83,9 @@ sup.upload() { sup.get_hash "$file" - if curl -fsL "${cfg_service_url}/api?mode=file&file=${file_hash}" >/dev/null; then - printf '%s\n' "${cfg_service_url}/hell/${file_hash}" + file_url=$( curl -fsL "${cfg_service_url}/api?mode=file&file=${file_hash}&direct=1" ) + if ! (( $? )); then + printf '%s\n' "$file_url" else if curl -fsL \ -F file="@$file" \