rm didn't work if the file was already uploaded
This commit is contained in:
parent
76952ee309
commit
b118e40f72
13
sup
13
sup
|
@ -88,7 +88,7 @@ sup.upload() {
|
||||||
if ! (( $? )); then
|
if ! (( $? )); then
|
||||||
printf '%s\n' "$file_url"
|
printf '%s\n' "$file_url"
|
||||||
else
|
else
|
||||||
if curl -sL \
|
curl -sL \
|
||||||
-F file="@$file" \
|
-F file="@$file" \
|
||||||
-F upload_mode='api' \
|
-F upload_mode='api' \
|
||||||
-F flag_private="$flag_private" \
|
-F flag_private="$flag_private" \
|
||||||
|
@ -98,15 +98,16 @@ sup.upload() {
|
||||||
-F submit="" \
|
-F submit="" \
|
||||||
-A 'zerofiles.org upload script' \
|
-A 'zerofiles.org upload script' \
|
||||||
"$cfg_service_url/upload"
|
"$cfg_service_url/upload"
|
||||||
then
|
fi
|
||||||
|
|
||||||
|
if (( $? )); then
|
||||||
|
sup.err 'Something has gone wrong with the upload.'
|
||||||
|
return 7
|
||||||
|
else
|
||||||
if (( flag_rm )); then
|
if (( flag_rm )); then
|
||||||
sup.msg "Removing file: $file"
|
sup.msg "Removing file: $file"
|
||||||
rm "$file"
|
rm "$file"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
sup.err 'Something has gone wrong with the upload.'
|
|
||||||
return 7
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user