-
Notifications
You must be signed in to change notification settings - Fork 588
Expand file tree
/
Copy pathabout
More file actions
executable file
·133 lines (105 loc) · 3.11 KB
/
about
File metadata and controls
executable file
·133 lines (105 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
############################################################################
#
# Copyright (c) 2012 - dsixda (dislam@rocketmail.com)
#
# Android Kitchen is 100% free. This script file is intended for personal
# and/or educational use only. It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################
clear
current_ver=$1
echo
echo "============================================================"
echo " Android Kitchen $current_ver - by dsixda (xda-developers.com)"
echo "============================================================"
echo
echo "About the Kitchen"
echo
echo "------------------------------------------------------------"
echo
echo " For help and discussion : http://bit.ly/aLKQaR"
echo " Follow dsixda on Twitter: http://www.twitter.com/dsixda"
echo " For Paypal donations : http://bit.ly/blHTKy"
echo
echo "------------------------------------------------------------"
echo
echo -n "Check online for updates (y/n)? (default: y): "
read do_update
if [ "$do_update" == "n" ]
then
exit 0
fi
echo
echo "Searching for updates ..."
notes=`scripts/get_latest_notes`
latest_ver=`echo $notes | sed -e 's/.*Version[ ]*\([0-9]*.[0-9]*\) (.*/\1/g' -e 's/[ ]*//g'`
if [ "$latest_ver" == "" ]
then
echo "Error: Unable to find update"
else
curr_major=`echo $current_ver | sed 's/\([0-9]*\).[0-9]*/\1/'`
curr_minor=`echo $current_ver | sed 's/[0-9]*.//'`
latest_major=`echo $latest_ver | sed 's/\([0-9]*\).[0-9]*/\1/'`
latest_minor=`echo $latest_ver | sed 's/[0-9]*.//'`
update=1
#
# Compare our version with version online
#
if [ $curr_major -gt $latest_major ]
then
update=0
else
if [ $curr_major -eq $latest_major ]
then
if [ $curr_minor -ge $latest_minor ]
then
update=0
fi
fi
fi
if [ $update == 0 ]
then
echo "Latest version online is $latest_ver. No update required."
else
echo "An update was found ($latest_ver)."
echo
echo "Release notes are found online."
# xda-developers updates the formatting of the page, so this routine would need to
# updated every time. Comment out for now.
#echo "$notes"
echo
echo -n "Download (y/n)? (default: y): "
read proceed_download
if [ "$proceed_download" == "n" ]
then
exit 0
fi
new_file=dsixda_Android_Kitchen_$latest_ver.zip
echo
echo "Downloading $new_file ..."
echo
url=https://github.com/dsixda/Android-Kitchen/archive/$latest_ver.zip
wget --no-check-certificate $url -O $new_file
echo
#Not supported on Mac?
#zip_size=`stat -c %s $new_file`
ls_size=`ls -l $new_file`
grep_empty=`echo $ls_size | grep -c " 0 "`
if [ -e $new_file ] && [ $grep_empty == 0 ]
then
echo "$new_file successfully downloaded"
echo "You must unzip this file to use the new kitchen"
else
echo "Error: $new_file was not downloaded"
rm -f $new_file
fi
fi
fi
if [ -e $check_filename ]
then
rm -f $check_filename
fi
echo
echo "Press Enter to continue"
read enterKey