forked from modded-ubuntu/modded-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·104 lines (90 loc) · 3.5 KB
/
setup.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
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
#!/bin/bash
R="$(printf '\033[1;31m')"
G="$(printf '\033[1;32m')"
Y="$(printf '\033[1;33m')"
B="$(printf '\033[1;34m')"
C="$(printf '\033[1;36m')"
W="$(printf '\033[1;37m')"
banner() {
clear
printf "\033[33m _ _ ___ _ _ _ _ ___ _ _ _ _ ____ ___ \033[0m\n"
printf "\033[36m | | |__] | | |\ | | | | |\/| | | | \ \033[0m\n"
printf "\033[32m |__| |__] |__| | \| | |__| | | |__| |__/ \033[0m\n"
printf "\033[0m\n"
printf " \033[32mA modded gui version of ubuntu for Termux\033[0m\n"
printf "\033[0m\n"
}
package() {
echo -e "${R} [${W}-${R}]${C} Checking required packages..."${W}
termux-setup-storage
if [[ `command -v pulseaudio` && `command -v proot-distro` && `command -v wget` ]]; then
echo -e "\n${R} [${W}-${R}]${G} Packages already installed."${W}
else
packs=(pulseaudio proot-distro wget)
for hulu in "${packs[@]}"; do
type -p "$hulu" &>/dev/null || {
echo -e "\n${R} [${W}-${R}]${G} Installing package : ${Y}$hulu${C}"${W}
apt update -y
apt upgrade -y
apt install "$hulu" -y
}
done
fi
}
distro() {
echo -e "\n${R} [${W}-${R}]${C} Checking for Distro..."${W}
termux-reload-settings
if [[ -d "$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04" ]]; then
echo -e "\n${R} [${W}-${R}]${G} Distro already installed."${W}
exit 0
else
proot-distro install ubuntu-20.04
termux-reload-settings
fi
if [[ -d "$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04" ]]; then
echo -e "\n${R} [${W}-${R}]${G} Installed Successfully !!"${W}
else
echo -e "\n${R} [${W}-${R}]${G} Error Installing Distro !\n"${W}
exit 0
fi
}
sound() {
echo -e "\n${R} [${W}-${R}]${C} Fixing Sound Problem..."${W}
if [[ ! -e "$HOME/.bashrc" ]]; then
touch $HOME/.bashrc
fi
echo "pulseaudio --start --exit-idle-time=-1" >> $HOME/.bashrc
echo "pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" >> $HOME/.bashrc
}
permission() {
banner
echo -e "${R} [${W}-${R}]${C} Setting up Environment..."${W}
if [[ -e "$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/root/user.sh" ]]; then
chmod +x $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/root/user.sh
else
wget https://raw.githubusercontent.com/modded-ubuntu/modded-ubuntu/master/distro/user.sh
mv -f user.sh $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/root/user.sh
chmod +x $PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu-20.04/root/user.sh
fi
echo "proot-distro login ubuntu-20.04" > $PREFIX/bin/ubuntu
if [[ -e "$PREFIX/bin/ubuntu" ]]; then
chmod +x $PREFIX/bin/ubuntu
termux-reload-settings
banner
echo -e "\n${R} [${W}-${R}]${G} Ubuntu-20.04(CLI) is now Installed on your Termux"${W}
echo -e "\n${R} [${W}-${R}]${G} Restart your Termux to Prevent Some Issues."${W}
echo -e "\n${R} [${W}-${R}]${G} Type ${C}ubuntu${G} to run Ubuntu CLI."${W}
echo -e "\n${R} [${W}-${R}]${G} If you Want to Use UBUNTU in GUI MODE then ,"${W}
echo -e "\n${R} [${W}-${R}]${G} Run ${C}ubuntu${G} first & then type ${C}bash user.sh "${W}
echo -e "\n"
exit 0
else
echo -e "\n${R} [${W}-${R}]${G} Error Installing Distro !"${W}
exit 0
fi
}
banner
package
distro
sound
permission