-
Notifications
You must be signed in to change notification settings - Fork 4
/
cus_add.sh
55 lines (50 loc) · 1.13 KB
/
cus_add.sh
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
#!/bin/bash
permis()
{
haa=$(sudo find $1)
for i in $haa; do
if [[ $i =~ "/bin/" ]]; then
sudo chmod 755 $i
echo $i
else
if [[ -d $i ]]; then
sudo chmod 755 $i
elif [[ -f $i ]]; then
sudo chmod 644 $i
fi
fi
sudo chcon u:object_r:system_file:s0 $i
#ls -laZ $i
done
}
if [[ -f addon.img ]] ; then
sudo rm addon.img
fi
echo "Download addon.img"
wget -q https://github.com/buihien224/host/raw/main/addon.img
linkcute=$(ls *.zip)
if [[ -f $linkcute ]]; then
echo "Phat hien $linkcute"
mkdir working custom
dd if=/dev/zero bs=1M count=612 >> addon.img
e2fsck -f -y addon.img > /dev/null 2>&1
resize2fs addon.img > /dev/null 2>&1
sudo mount addon.img working
echo "Giai nen $linkcute"
mv $linkcute custom ; cd custom
jar xf $linkcute ; rm $linkcute
cd ..
echo "Copy file vao addon.img"
sudo cp -rf custom/* working
echo "Set quyen va SEcontest"
permis working
echo "Chay file sh tuy chinh"
sh=$(ls *.sh)
chmod +x $sh
./$sh
cd ..
sudo umount working
resize2fs -f -M addon.img > /dev/null 2>&1
rm -rf working custom
echo "Xong, hay copy file addon.img vao module/update"
fi