X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/blobdiff_plain/3f148399e9109e25741fcd4a32e17317c573a5ea..f7edf230e7b2fa45a63d465ab7a1cf2e4a6c3fc7:/bti-shrink-urls diff --git a/bti-shrink-urls b/bti-shrink-urls index ee85b4c..aa9eb57 100755 --- a/bti-shrink-urls +++ b/bti-shrink-urls @@ -42,7 +42,7 @@ done function convert_url() { local url=$1 test -n "$url" || return 1 - test "${url%:*}" = 'http' || return 1 + test "${url%%:*}" = 'http' || return 1 local urllen="${#url}" @@ -73,7 +73,7 @@ function convert_url() { local submit="http://2tu.us/?save=y&url=$url" local res=$(wget -q -O - "$submit" | awk -F"'" '/Your tight URL is:/ { print $2 }') - if test "${res%:*}" = 'http' -a "${#res}" -lt "$urllen" ; then + if test "${res%%:*}" = 'http' -a "${#res}" -lt "$urllen" ; then echo $res return 0 fi