File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,10 @@ This script lets you to **quickly shrink with z0r.it** any link and put the shri
2323* z0r -l* -> show history
2424
2525* z0r -m <long_URL1> <long_URL2>* ... -> mass shorting
26+
27+ * z0r -r* -> reset history
28+
29+ * z0r -u* -> show updates
30+
31+ Dependencies:
32+ wget, curl, xclip, awk
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ readonly YELLOW="\033[00;33m"
2222readonly BOLD=" \033[01m"
2323readonly FINE=" \033[0m"
2424
25- ver=' 1.5 '
25+ ver=' v1.6 '
2626regex=' (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*\.[A-Za-z0-9\+&@%#/=~_|():?]+'
2727is_z0r=' http://z0r.it/[^ \n]'
2828url=(http://$1 )
@@ -72,6 +72,7 @@ help(){
7272 echo " -l show shorting history"
7373 echo " -m <long_URL1> <long_URL2> ... mass shorting"
7474 echo " -r reset history"
75+ echo " -u show updates"
7576 echo -e $GREEN " ======================================================================================" $FINE
7677
7778 }
@@ -141,9 +142,17 @@ del_history(){
141142 ;;
142143 esac
143144}
145+ check_ver (){
146+ r_ver=$( curl -s " https://api.github.com/repos/InforgeNet/z0r-script/releases" | egrep -m 1 --color ' tag_name":\s*".*"' | cut -d ' "' -f 4)
147+ if [ ! " $r_ver " = " $ver " ]; then
148+ echo -e $GREEN " Update found" $FINE
149+ else
150+ echo -e $RED " No update found" $FINE
151+ fi
152+ }
144153# option parser
145154opsparser (){
146- while getopts " :hvlrde :c:m:" opt; do
155+ while getopts " :hvulrde :c:m:" opt; do
147156 case " $opt " in
148157 h) help
149158 exit 0
@@ -165,6 +174,9 @@ while getopts ":hvlrde:c:m:" opt; do
165174 mss $@
166175 exit 0
167176 ;;
177+ u) check_ver
178+ exit 0
179+ ;;
168180 v) echo $ver
169181 exit 0
170182 ;;
You can’t perform that action at this time.
0 commit comments