@@ -192,6 +192,11 @@ upload() {
|
|||||||
get_shortlink() {
|
get_shortlink() {
|
||||||
declare url=$1 api_response api_status api_status_message
|
declare url=$1 api_response api_status api_status_message
|
||||||
|
|
||||||
|
[[ $url ]] || {
|
||||||
|
err "URL is empty!"
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
api_response=$( curl --data-urlencode "url=$url" \
|
api_response=$( curl --data-urlencode "url=$url" \
|
||||||
--data-urlencode "secret=$secret" \
|
--data-urlencode "secret=$secret" \
|
||||||
"$cfg_service_url/shrink.json" )
|
"$cfg_service_url/shrink.json" )
|
||||||
@@ -474,7 +479,7 @@ main() {
|
|||||||
get_token || return $?
|
get_token || return $?
|
||||||
|
|
||||||
for t in "${args[@]}"; do
|
for t in "${args[@]}"; do
|
||||||
get_shortlink "$t"
|
get_shortlink "$t" || return 1
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user