added direct image link in share script
This commit is contained in:
parent
73559fde88
commit
70a23c0d55
6
share.sh
6
share.sh
@ -36,4 +36,10 @@ SLUG=$(curl -s -u "$API_USERNAME:$API_PASSWORD" -X POST --header "Content-Type
|
|||||||
--data "{\"key\":\"$UPLOAD_FILENAME\"}" \
|
--data "{\"key\":\"$UPLOAD_FILENAME\"}" \
|
||||||
"$ENDPOINT/api/share" | jq -r ".slug")
|
"$ENDPOINT/api/share" | jq -r ".slug")
|
||||||
|
|
||||||
|
|
||||||
|
MIME=$(file -i -b "$UPLOAD_FILE")
|
||||||
|
if echo "$MIME" | grep "image" &> /dev/null; then
|
||||||
|
printf "%s/s/%s.%s\n" "$ENDPOINT" "$SLUG" "${UPLOAD_FILENAME##*.}"
|
||||||
|
else
|
||||||
printf "%s/%s\n" "$ENDPOINT" "$SLUG"
|
printf "%s/%s\n" "$ENDPOINT" "$SLUG"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user