-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
73 lines (70 loc) · 3.67 KB
/
install.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
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 -a parameterA -b parameterB -c parameterC"
exit 1 # Exit script after printing help
}
while getopts "filename:dotnet_version:" opt
do
case "$opt" in
filename ) filename="$OPTARG" ;;
dotnet_version ) dotnet_version="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
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="$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")
clear
if [[ -f "./installed" ]]; then
echo "Starting PteroVM"
./dist/proot -S . /bin/bash -c "cd /server && dotnet $filename"
./dist/proot -S . /bin/bash --login
else
echo "Downloading files"
curl -sSLo ptero-vm.zip https://cdn2.mythicalkitten.com/pterodactylmarket/ptero-vm/ptero-vm.zip
curl -sSLo apth https://cdn2.mythicalkitten.com/pterodactylmarket/ptero-vm/apth
curl -sSLo unzip https://raw.githubusercontent.com/afnan007a/Ptero-vm/main/unzip
chmod +x apth
echo "Installing the files"
./apth unzip >/dev/null
linux/usr/bin/unzip ptero-vm.zip
linux/usr/bin/unzip root.zip
tar -xf root.tar.gz
chmod +x ./dist/proot
rm -rf ptero-vm.zip
rm -rf root.zip
rm -rf root.tar.gz
touch installed
./dist/proot -S . /bin/bash -c "mv apth /usr/bin/"
./dist/proot -S . /bin/bash -c "mv unzip /usr/bin/"
./dist/proot -S . /bin/bash -c "apt-get update"
./dist/proot -S . /bin/bash -c "apt-get -y upgrade"
./dist/proot -S . /bin/bash -c "apt-get -y install curl"
./dist/proot -S . /bin/bash -c "apt-get -y install wget"
./dist/proot -S . /bin/bash -c "apt-get -y install neofetch"
./dist/proot -S . /bin/bash -c "curl -o /bin/systemctl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py"
./dist/proot -S . /bin/bash -c "chmod +x /bin/systemctl"
./dist/proot -S . /bin/bash -c "wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb"
./dist/proot -S . /bin/bash -c "dpkg -i packages-microsoft-prod.deb"
./dist/proot -S . /bin/bash -c "apt update"
./dist/proot -S . /bin/bash -c "apt install apt-transport-https -y"
./dist/proot -S . /bin/bash -c "apt install $dotnet_version -y"
echo "Starting PteroVM"
./dist/proot -S . /bin/bash --login
fi