-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathinit
166 lines (158 loc) · 4.72 KB
/
init
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash
# KD4Z
# Version: 4.30
# called after git pull, and before everything else, use to setup script exec mode
if [ -d ~/save ] && [ ! -d ~/archive ]; then
mv ~/save ~/archive
fi
if [ ! -d ~/archive ]; then
mkdir ~/archive
fi
if [ ! -d ~/screenshots ]; then
mkdir ~/screenshots
fi
if [ -f ~/md380tools-vm/exec.pre ]; then
chmod +x ~/md380tools-vm/exec.pre
fi
if [ -f ~/md380tools-vm/menuopts ]; then
chmod +x ~/md380tools-vm/menuopts
fi
if [ -f ~/md380tools-vm/exec.post ]; then
chmod +x ~/md380tools-vm/exec.post
fi
if [ -f ~/md380tools-vm/addstatic ]; then
chmod +x ~/md380tools-vm/addstatic
fi
if [ -f ~/md380tools-vm/flashdb ]; then
chmod +x ~/md380tools-vm/flashdb
fi
if [ -f ~/md380tools-vm/recipes ]; then
chmod +x ~/md380tools-vm/recipes
fi
if [ -f ~/md380tools-vm/lookup ]; then
chmod +x ~/md380tools-vm/lookup
fi
if [ -f ~/md380tools-vm/tweakopts ]; then
chmod +x ~/md380tools-vm/tweakopts
fi
if [ -f ~/md380tools-vm/rotatebins ]; then
chmod +x ~/md380tools-vm/rotatebins
fi
if [ -f ~/md380tools-vm/writeblankplug ]; then
chmod +x ~/md380tools-vm/writeblankplug
fi
if [ -f ~/md380tools-vm/root/flashdb ]; then
cp ~/md380tools-vm/root/flashdb ~
chmod +x ~/flashdb
fi
if [ -f ~/md380tools-vm/root/lookup ]; then
cp ~/md380tools-vm/root/lookup ~
chmod +x ~/lookup
fi
if [ -f ~/md380tools-vm/filter.sys ]; then
chmod +x ~/md380tools-vm/filter.sys
fi
if [ -f ~/md380tools-vm/root/tweaks ]; then
cp ~/md380tools-vm/root/tweaks ~
chmod +x ~/tweaks
fi
if [ -f ~/md380tools-vm/root/save ]; then
cp ~/md380tools-vm/root/save ~
chmod +x ~/save
fi
if [ -f ~/md380tools-vm/root/restore ]; then
cp ~/md380tools-vm/root/restore ~
chmod +x ~/restore
fi
if [ -f ~/md380tools-vm/root/uploadfile.sample ]; then
cp ~/md380tools-vm/root/uploadfile.sample ~
chmod +x ~/uploadfile.sample
fi
if [ -f ~/md380tools-vm/root/build ]; then
cp ~/md380tools-vm/root/build ~
chmod +x ~/build
fi
if [ -f ~/md380tools-vm/root/get_special_IDs.py ]; then
cp ~/md380tools-vm/root/get_special_IDs.py ~/md380tools/db/get_special_IDs.py
fi
if [ -f ~/md380tools-vm/root/glvusers ]; then
cp ~/md380tools-vm/root/glvusers ~
chmod +x ~/glvusers
fi
if [ -f ~/md380tools-vm/snap ]; then
chmod +x ~/md380tools-vm/snap
fi
if [ -f ~/md380tools-vm/stats ]; then
chmod +x ~/md380tools-vm/stats
fi
cp ~/md380tools-vm/menuopts ~
chmod +x ~/menuopts
if [ -f ~/md380tools-vm/root/exec.patch ]; then
chmod +x ~/md380tools-vm/root/exec.patch
~/md380tools-vm/root/exec.patch
rm ~/md380tools-vm/root/exec.patch
fi
if [ -f ~/md380tools-vm/root/exec.nosleep.patch ] && [ -f ~/nosleep.enable ]; then
chmod +x ~/md380tools-vm/root/exec.nosleep.patch
~/md380tools-vm/root/exec.nosleep.patch
rm ~/md380tools-vm/root/exec.nosleep.patch
echo -e "${RED}Adding workaround for version 5 hardware."
echo -e "${RED}This will bypass some battery saver features"
echo -e "${RED}so expect slightly less battery life."
echo -e "${YELLOW}rm ~/nosleep.enable ${RED}to disable this workaround for next glv.${NC}"
sleep 8
fi
# for flashdb progress until merged upstream
if [ -f ~/md380tools-vm/root/md380_tool.py ]; then
cp ~/md380tools-vm/root/md380_tool.py ~/md380tools/md380_tool.py
fi
if [ -f /etc/motd.save ]; then
cp ~/md380tools-vm/root/.bash_aliases ~
cp ~/md380tools-vm/root/.bashrc ~
else
chmod +x ~/md380tools-vm/updatecheck
if [ -f .bash_aliases.version ] ; then
rm .bash_aliases.version
fi
if [ -f ~/md380tools-vm/root/alias_version.zip ]; then
cd ~
unzip -o ~/md380tools-vm/root/alias_version.zip
fi
~/md380tools-vm/updatecheck
fi
# clean out unmonitored files if found
if [ -f ~/fill.nickname.enable ]; then
rm ~/fill.nickname.enable
fi
# abbreviations are ON now by default now
if [ -f ~/filter.countries.disable ]; then
rm ~/filter.countries.disable
fi
if [ -f ~/filter.us.states.disable ]; then
rm ~/filter.us.states.disable
fi
# which will require this anyway
if [ ! -f ~/filter.sys.disable ]; then
touch ~/filter.sys.enable
fi
if [ -f ~/md380tools-vm/archive/firmware-GPS.bin.stable ]; then
cp ~/md380tools-vm/archive/firmware-GPS.bin.stable ~/archive
fi
if [ -f ~/md380tools-vm/archive/firmware-noGPS.bin.stable ]; then
cp ~/md380tools-vm/archive/firmware-noGPS.bin.stable ~/archive
fi
if [ -f ~/md380tools-vm/archive/user.bin.stable ]; then
cp ~/md380tools-vm/archive/user.bin.stable ~/archive
fi
if [ -f ~/md380tools-vm/archive/blankplugMD380.bin ]; then
cp ~/md380tools-vm/archive/blankplugMD380.bin ~/archive
fi
if [ -f ~/md380tools-vm/archive/blankplugMD380.rdt ]; then
cp ~/md380tools-vm/archive/blankplugMD380.rdt ~/archive
fi
# local hook if desired for user provided preprocessing
if [ -f ~/exec.init.local ]; then
echo -e "${YELLOW}Executing ~/exec.init.local${NC}"
chmod +x ~/exec.init.local
~/exec.init.local
fi