File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ readonly YELLOW="\033[00;33m"
2222readonly BOLD=" \033[01m"
2323readonly FINE=" \033[0m"
2424
25- ver=' 1.1 '
25+ ver=' 1.2 '
2626regex=' (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*\.[-A-Za-z0-9\+&@#/%=~_|():?]+'
2727is_z0r=' http://z0r.it/[^ \n]'
2828url=(http://$1 )
2929mode=-s
30- dep=(curl awk xclip)
30+ dep=(curl awk xclip wget )
3131apikey=4e4b657a91
3232# upload function (long -> short)
3333shr (){
@@ -69,10 +69,18 @@ echo $click
6969# control over argument
7070is_url (){
7171if [[ $1 =~ $regex ]]; then
72+ if wget --spider " $1 " 2> /dev/null; then
7273 shr $1 $2
74+ else
75+ echo -e $RED " Page does not exist" $FINE
76+ fi
7377else
7478if [[ $url =~ $regex ]]; then
75- shr $1 $2
79+ if wget --spider " $1 " 2> /dev/null; then
80+ shr $1 $2
81+ else
82+ echo -e $RED " Page does not exist" $FINE
83+ fi
7684else
7785 echo -e $RED " Enter a valid url" $FINE
7886fi
You can’t perform that action at this time.
0 commit comments