This commit is contained in:
Jack L. Frost 2016-03-03 21:49:49 +03:00
parent ef3cd20dfc
commit 3fe0d59815
1 changed files with 17 additions and 16 deletions

33
ufw
View File

@ -110,21 +110,17 @@ upload() {
get_file_hash "$file" get_file_hash "$file"
file_url=$( curl -fsL "${cfg_service_url}/api?mode=file&file=${file_hash}&direct=1&short=${flag_shortlink}" ) curl -sL \
if ! (( $? )); then -F file="@$file" \
printf '%s\n' "$file_url" -F upload_mode='api' \
else -F flag_private="$flag_private" \
curl -sL \ -F short="$flag_shortlink" \
-F file="@$file" \ -F secret="$secret" \
-F upload_mode='api' \ -F submit="" \
-F flag_private="$flag_private" \ "${misc_curl_args[@]}" \
-F short="$flag_shortlink" \ -A 'zerofiles.org upload script' \
-F secret="$secret" \ "$cfg_service_url/upload"
-F submit="" \ fi
"${misc_curl_args[@]}" \
-A 'zerofiles.org upload script' \
"$cfg_service_url/upload"
fi
if (( $? )); then if (( $? )); then
err 'Something has gone wrong with the upload.' err 'Something has gone wrong with the upload.'
@ -278,8 +274,13 @@ main() {
shift shift
;; ;;
-A|--album-name)
misc_curl_args+=( -F "album_name=$2" )
shift
;;
-d|--description) -d|--description)
misc_curl_args+=( -F "description=$description" ) misc_curl_args+=( -F "description=$2" )
shift shift
;; ;;