forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_binaries
More file actions
executable file
·111 lines (85 loc) · 2.42 KB
/
check_binaries
File metadata and controls
executable file
·111 lines (85 loc) · 2.42 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
############################################################################
#
# Copyright (c) 2012 - dsixda ([email protected])
#
# 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.
#
############################################################################
bin_list=( clear gcc java perl sed wget od wc cpio zip unzip )
arg_list=( foo dumpversion version v -version V -version -version -version -help -help )
show_header=1
for (( i = 0 ; i < ${#bin_list[@]} ; i++ ))
do
if [ $show_header == 1 ]
then
clear
echo
echo
echo
echo
echo "Welcome to dsixda's Android Kitchen"
echo
echo -n "Please wait "
for (( count = 0 ; $count <= $i ; count++ ))
do
echo -n "."
done
show_header=0
else
echo -n "."
fi
found_error=0
bin=${bin_list[$i]}
argmt=${arg_list[$i]}
res=`$bin -$argmt 2>/dev/null`
result=$?
if [ "$result" == "127" ]
then
echo
echo
echo "Error: The application '$bin' is not installed - the kitchen"
echo " will not function properly without it. Ensure you did"
echo " not miss a step during installation! Refer to the"
echo " Android Kitchen FAQ at xda-developers.com for further"
echo " assistance."
echo
echo " ** PLEASE READ THE FAQ BEFORE ASKING QUESTIONS!! **"
echo
if [ "$bin" == "clear" ]
then
echo " YES, THIS ERROR IS ALREADY COVERED IN THE FAQ. DO NOT"
echo " WASTE YOUR TIME MESSAGING ME. JUST READ IT, PLEASE. ;)"
echo
fi
found_error=1
elif [ "$bin" == "sed" ] || [ "$bin" == "od" ]
then
grep_cmd=`$bin --version | grep -m 1 GNU`
if [ "$grep_cmd" == "" ]
then
echo
echo
echo "Error: You do not have the correct version of '$bin' installed."
echo " Refer to the FAQ for the Android Kitchen at"
echo " xda-developers.com to ensure you have installed the GNU"
echo " version of $bin."
echo
found_error=1
fi
fi
if [ $found_error == 1 ]
then
#echo -n "Ignore and proceed anyway (y/n)? (default: n): "
#read proceedCheck
proceedCheck=n
if [ "$proceedCheck" != "y" ]
then
exit 1
else
show_header=1
fi
fi
done
exit 0