-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathandroid_scriptmaker.sh
More file actions
94 lines (94 loc) · 2.26 KB
/
Copy pathandroid_scriptmaker.sh
File metadata and controls
94 lines (94 loc) · 2.26 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
#!/bin/sh
####################################################################
## ===> Script author: Facundo Montero ([email protected]) <=== ##
####################################################################
# Workaround for find listing format.
CURFILE=2
# Reset (if setted) RUNSCRIPT variable.
RUNSCRIPT=0
# Delete existing file (if any) and suppress output (if not existing).
rm -f /sdcard/add-this-updater-script
rm -f /sdcard/tempflist
echo "##############"
echo "Welcome, this script will make a appendeable file for your already installed ROM (used for modding)"
echo "##############"
echo "Please type 'yes' (without quotes) to continue: "
read RUNSCRIPT
if [ $RUNSCRIPT == 'yes' ]
then
echo "Okay! We're going to do some test, just to make sure your device supports: head, tail, tee, grep, wc and cat."
echo "##############"
echo "Testing 'tee'"
echo "##############"
echo "test" | head -1
if [ $? -eq 0 ]
then
echo "'head' is working :-)"
else
echo "Nope, no 'head'. Please install it and try again."
exit 1
fi
echo "test" | tail -1
if [ $? -eq 0 ]
then
echo "'tail' is working :-)"
else
echo "Nope, no 'tail'. Please install it and try again."
exit 1
fi
echo "test" | tee /sdcard/testtee
if [ $? -eq 0 ]
then
echo "'tee' is working :-)"
else
echo "Nope, no 'tee'. Please install it and try again."
rm -f /sdcard/testee
exit 1
fi
echo "test" | grep "test"
if [ $? -eq 0 ]
then
echo "'grep' is working :-)"
else
echo "Nope, no 'grep'. Please install it and try again."
exit 1
fi
echo "test" | wc
if [ $? -eq 0 ]
then
echo "'wc' is working :-)"
else
echo "Nope, no 'wc'. Please install it and try again."
exit 1
fi
cat /sdcard/testtee
if [ $? -eq 0 ]
then
echo "'cat' is working :-)"
else
echo "Nope, no 'cat'. Please install it and try again."
rm -f /sdcard/testtee
exit 1
fi
echo "test" | sed 's/test//'
if [ $? -eq 0 ]
then
echo "'sed' is working :-)"
else
echo "Nope, no 'sed'. Please install it and try again."
exit 1
fi
fi
if [ $RUNSCRIPT == 'yes' ]
then
FILES=./system/*
for FILE in $FILES
do
PERMS=`stat -c '%A %a %n' $FILE | cut -d " " -f2`
printf "set_perm (1000, 1000, 0$PERMS, \"$FILE\");\n" >> /sdcard/add-this-updater-script
echo $FILE
done
else
echo "Okie! See you ;)"
exit 0
fi