File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed 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=' v1.6.2 '
25+ ver=' v1.7 '
2626regex=' (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*\.[A-Za-z0-9\+&@%#/=~_|():?]+'
2727is_z0r=' http://z0r.it/[^ \n]'
2828url=(http://$1 )
@@ -125,7 +125,7 @@ is_url(){
125125checkdep (){
126126 for i in " ${dep[@]} " ; do
127127 if ( ! which $i & > /dev/null ); then
128- echo -e $RED " $i not found, solve the dipendencies before running the script" $FINE
128+ echo -e $RED " $i not found, solve the dipendencies before running the script" $FINE
129129 missing=" 1"
130130 fi
131131 done
@@ -143,7 +143,15 @@ del_history(){
143143check_ver (){
144144 r_ver=$( curl -s " https://api.github.com/repos/InforgeNet/z0r-script/releases" | egrep -m 1 --color ' tag_name":\s*".*"' | cut -d ' "' -f 4)
145145 if [ ! " $r_ver " = " $ver " ]; then
146- echo -e $GREEN " Update found(https://github.com/InforgeNet/z0r-script)" $FINE
146+ echo -e $BLUE " $r_ver " $FINE $GREEN " update found(https://github.com/InforgeNet/z0r-script)" $FINE
147+ echo -e $GREEN " Want to download the $r_ver release(zipball)?[y/n]" $FINE
148+ read input
149+ case $input in
150+ [Yy]) wget -q --show-progress https://github.com/InforgeNet/z0r-script/zipball/master -O $HOME /z0r-$r_ver .zip
151+ ;;
152+ * ) exit 0
153+ ;;
154+ esac
147155 else
148156 echo -e $RED " No update found" $FINE
149157fi
@@ -193,12 +201,11 @@ done
193201checkdep
194202if [ " $missing " == " 1" ]; then
195203 exit 0
196- else
204+ fi
197205opsparser $@
198- if [ " $# " == " 0" ]; then
206+ if [ " $# " == " 0" ]; then
199207 set -- " $clip "
200208 is_url $1
201209else
202210 is_url $1 $2
203211fi
204- fi
You can’t perform that action at this time.
0 commit comments