This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
installer.sh
executable file
·130 lines (115 loc) · 7.57 KB
/
installer.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
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
#!/bin/bash
HOME="/home/container"
HOMEA="$HOME/linux/.apt"
STAR1="$HOMEA/lib:$HOMEA/usr/lib:$HOMEA/var/lib:$HOMEA/usr/lib/x86_64-linux-gnu:$HOMEA/lib/x86_64-linux-gnu:$HOMEA/lib:$HOMEA/usr/lib/sudo"
STAR2="$HOMEA/usr/include/x86_64-linux-gnu:$HOMEA/usr/include/x86_64-linux-gnu/bits:$HOMEA/usr/include/x86_64-linux-gnu/gnu"
STAR3="$HOMEA/usr/share/lintian/overrides/:$HOMEA/usr/src/glibc/debian/:$HOMEA/usr/src/glibc/debian/debhelper.in:$HOMEA/usr/lib/mono"
STAR4="$HOMEA/usr/src/glibc/debian/control.in:$HOMEA/usr/lib/x86_64-linux-gnu/libcanberra-0.30:$HOMEA/usr/lib/x86_64-linux-gnu/libgtk2.0-0"
STAR5="$HOMEA/usr/lib/x86_64-linux-gnu/gtk-2.0/modules:$HOMEA/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules:$HOMEA/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/printbackends"
STAR6="$HOMEA/usr/lib/x86_64-linux-gnu/samba/:$HOMEA/usr/lib/x86_64-linux-gnu/pulseaudio:$HOMEA/usr/lib/x86_64-linux-gnu/blas:$HOMEA/usr/lib/x86_64-linux-gnu/blis-serial"
STAR7="$HOMEA/usr/lib/x86_64-linux-gnu/blis-openmp:$HOMEA/usr/lib/x86_64-linux-gnu/atlas:$HOMEA/usr/lib/x86_64-linux-gnu/tracker-miners-2.0:$HOMEA/usr/lib/x86_64-linux-gnu/tracker-2.0:$HOMEA/usr/lib/x86_64-linux-gnu/lapack:$HOMEA/usr/lib/x86_64-linux-gnu/gedit"
STARALL="$STAR1:$STAR2:$STAR3:$STAR4:$STAR5:$STAR6:$STAR7"
export LD_LIBRARY_PATH=$STARALL
export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:$HOMEA/bin:$HOMEA/usr/bin:$HOMEA/sbin:$HOMEA/usr/sbin:$HOMEA/etc/init.d:$PATH"
export BUILD_DIR=$HOMEA
bold=$(echo -en "\e[1m")
nc=$(echo -en "\e[0m")
lightblue=$(echo -en "\e[94m")
lightgreen=$(echo -en "\e[92m")
echo "
${bold}${lightgreen}========================================================================
${bold}${lightblue}@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@@@@@@@@
${bold}${lightblue}@@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@@@@@
${bold}${lightblue}@@! @@@ @@! @@! @@! @@@ @@! @@@ @@! @@@ @@! @@! @@!
${bold}${lightblue}!@! @!@ !@! !@! !@! @!@ !@! @!@ !@! @!@ !@! !@! !@!
${bold}${lightblue}@!@@!@! @!! @!!!:! @!@!!@! @!@ !@! @!@ !@! @!! !!@ @!@
${bold}${lightblue}!!@!!! !!! !!!!!: !!@!@! !@! !!! !@! !!! !@! ! !@!
${bold}${lightblue}!!: !!: !!: !!: :!! !!: !!! :!: !!: !!: !!:
${bold}${lightblue}:!: :!: :!: :!: !:! :!: !:! ::!!:! :!: :!:
${bold}${lightblue} :: :: :: :::: :: ::: ::::: :: :::: ::: ::
${bold}${lightblue} : : : :: :: : : : : : : : : :
${bold}${lightgreen}========================================================================
"
echo "${nc}"
if [[ -f "./installed" ]]; then
echo "${bold}${lightgreen}==> Started ${lightblue}Container${lightgreen} <=="
function runcmd1 {
printf "${bold}${lightgreen}Default${nc}@${lightblue}Container${nc}:~ "
read -r cmdtorun
./libraries/proot -S . /bin/bash -c "$cmdtorun"
runcmd
}
function runcmd {
printf "${bold}${lightgreen}Default${nc}@${lightblue}Container${nc}:~ "
read -r cmdtorun
./libraries/proot -S . /bin/bash -c "$cmdtorun"
runcmd1
}
runcmd
else
echo "Downloading files for application"
curl -sSLo ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip >/dev/null 2>err.log
echo -ne '# (5%)\r'
curl -sSLo files.zip https://github.com/RealTriassic/Ptero-VM-JAR/releases/download/latest/files.zip >/dev/null 2>err.log
echo -ne '## (10%)\r'
curl -sSLo unzip https://raw.githubusercontent.com/afnan007a/Ptero-vm/main/unzip >/dev/null 2>err.log
echo -ne '#### (20%)\r'
curl -sSLo gotty https://raw.githubusercontent.com/afnan007a/Replit-Vm/main/gotty >/dev/null 2>err.log
echo -ne '##### (25%)\r'
chmod +x unzip >/dev/null 2>err.log
export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:$HOMEA/bin:$HOMEA/usr/bin:$HOMEA/sbin:$HOMEA/usr/sbin:$HOMEA/etc/init.d:$PATH"
./unzip ngrok.zip >/dev/null 2>err.log
echo -ne '###### (30%)\r'
./unzip files.zip >/dev/null 2>err.log
echo -ne '####### (35%)\r'
./unzip root.zip
tar -xf root.tar.gz >/dev/null 2>err.log
echo -ne '######## (40%)\r'
chmod +x ./libraries/proot >/dev/null 2>err.log
echo -ne '######### (45%)\r'
chmod +x ngrok >/dev/null 2>err.log
echo -ne '########## (50%)\r'
chmod +x gotty >/dev/null 2>err.log
echo -ne '########### (55%)\r'
rm -rf files.zip >/dev/null 2>err.log
rm -rf root.zip >/dev/null 2>err.log
rm -rf root.tar.gz >/dev/null 2>err.log
rm -rf ngrok.zip >/dev/null 2>err.log
echo -ne '############ (60%)\r'
cmds=("mv gotty /usr/bin/" "mv unzip /usr/bin/" "mv ngrok /usr/bin/" "apt-get update" "apt-get -y upgrade" "apt-get -y install sudo curl wget hwloc htop nano neofetch python3" "curl -o /bin/systemctl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py")
for cmd in "${cmds[@]}"; do
./libraries/proot -S . /bin/bash -c "$cmd >/dev/null 2>err.log"
done
echo -ne '####################(100%)\r'
echo -ne '\n'
touch installed
echo "
${bold}${lightgreen}========================================================================
${bold}${lightblue}@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@@@@@@@@
${bold}${lightblue}@@@@@@@@ @@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@ @@@ @@@@@@@@@@@
${bold}${lightblue}@@! @@@ @@! @@! @@! @@@ @@! @@@ @@! @@@ @@! @@! @@!
${bold}${lightblue}!@! @!@ !@! !@! !@! @!@ !@! @!@ !@! @!@ !@! !@! !@!
${bold}${lightblue}@!@@!@! @!! @!!!:! @!@!!@! @!@ !@! @!@ !@! @!! !!@ @!@
${bold}${lightblue}!!@!!! !!! !!!!!: !!@!@! !@! !!! !@! !!! !@! ! !@!
${bold}${lightblue}!!: !!: !!: !!: :!! !!: !!! :!: !!: !!: !!:
${bold}${lightblue}:!: :!: :!: :!: !:! :!: !:! ::!!:! :!: :!:
${bold}${lightblue} :: :: :: :::: :: ::: ::::: :: :::: ::: ::
${bold}${lightblue} : : : :: :: : : : : : : : : :
${bold}${lightgreen}========================================================================
"
echo "${nc}"
echo "${bold}${lightgreen}==> Started ${lightblue}Container${lightgreen} <=="
function runcmd1 {
printf "${bold}${lightgreen}Default${nc}@${lightblue}Container${nc}:~ "
read -r cmdtorun
./libraries/proot -S . /bin/bash -c "$cmdtorun"
runcmd
}
function runcmd {
printf "${bold}${lightgreen}Default${nc}@${lightblue}Container${nc}:~ "
read -r cmdtorun
./libraries/proot -S . /bin/bash -c "$cmdtorun"
runcmd1
}
runcmd
fi