here string removed
This commit is contained in:
parent
20c1eada6f
commit
afaca0a0b6
1 changed files with 3 additions and 3 deletions
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null; then
|
if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then
|
||||||
url="$1"
|
url="$1"
|
||||||
else
|
else
|
||||||
url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" |
|
url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" |
|
||||||
sed -E 's_^.*href="(https?://[^"]+)".*$_\1_')"
|
grep -o "https?://[^\" ]")"
|
||||||
|
|
||||||
! grep "https*://\S\+\.[A-Za-z]\+\S*" <<<"$url" &&
|
echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ||
|
||||||
notify-send "That doesn't look like a full URL." && exit 1
|
notify-send "That doesn't look like a full URL." && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue