/
install.sh
183 lines (158 loc) · 6.16 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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
clear
# Sudoer permission
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo env "HOME='$HOME'" $0 $*"
exit 1
fi
# Colors Section
YELLOW='\033[1;33m'
GREY='\033[1;37m'
PURPUL='\033[0;35m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m'
# Function Progress
Spinner (){
pid=$!
spin='-\|/'
i=0
while kill -0 $pid 2>/dev/null
do
i=$(( (i+1) %4 ))
printf "\r [${spin:$i:1}] $1"
sleep .1
done
printf "\r [${GREEN}\xE2\x9C\x94${NC}] $1 \n"
}
# Home Section
logo(){
printf "${RED}
_______ _____ _____ _____ _ _ _
|__ __| ____| / ____| |_ _| | | | | |
| | | |__ | (___ ___ _ ____ _____ _ __ | | _ __ ___| |_ __ _| | | ___ _ __
| | |___ \ \___ \ / _ \ \'__\ \ / / _ \ \'__| | | | \'_ \/ __| __/ _\` | | |/ _ \ \'__|
| | ___) | ____) | __/ | \ V / __/ | _| |_| | | \__ \ || (_| | | | __/ |
|_| |____/ |_____/ \___|_| \_/ \___|_| |_____|_| |_|___/\__\__,_|_|_|\___|_|
${NC}
╔══════════════════════════════╗
║ Made by ${BLUE}Sterbweise${NC} ║
╠══════════════════════════════╣
║ ${PURPUL}\e]8;;https://github.com/Sterbweise\e\\Github\e]8;;\e\\\\${NC} | ${RED}\e]8;;https://www.youtube.com/channel/UCRWfp6bi0-wlhaRe2YQ2dwQ\e\\Youtube\e]8;;\e\\\\${NC} | ${GREY}\e]8;;https://forum.plutonium.pw/user/minami\e\\Plutonium\e]8;;\e\\\\${NC} ║
╚══════════════════════════════╝ \n \n"
}
logo
# Languages Selection
printf "
${YELLOW}Select your languages : ${NC}
[0] English
[1] French
\n
"
read -p '>>> ' languages
clear
logo
# Choices Section
mfirewall=('Do you want install UFW firewall (Y/n) ?' 'Voulez-vous installer le pare-feu UFW (O/n) ?')
printf "${YELLOW}${mfirewall[$languages]}${NC}\n"
read -p '>>> ' firewall
mdotnet=('Do you want install Dotnet [Required for IW4Madmin] (Y/n) ?' 'Voulez-vous installer Dotnet [Requis pour IW4Madmin] (O/n) ?')
printf "\n\n${YELLOW}${mdotnet[$languages]}${NC}\n"
read -p '>>> ' dotnet
stty igncr
clear
logo
# Update Systeme
mupdate=('Updating the system' 'Mise a jours du systeme')
{
apt update
} > /dev/null 2>&1 &
Spinner "${mupdate[$languages]}"
# Setup Firewall
if [ "$firewall" = 'y' ] || [ "$firewall" = '' ] || [ "$firewall" = 'Y' ] || [ "$firewall" = 'o' ] || [ "$firewall" = 'O' ] ; then
mfirewall2=('Firewall installation and ssh port opening.' 'Installation du pare-feu et ouverture du port ssh.')
{
apt install ufw fail2ban -y && \
ufw allow 22/tcp && \
ufw default allow outgoing && \
ufw default deny incoming && \
ufw -f enable
} > /dev/null 2>&1 &
Spinner "${mfirewall2[$languages]}"
fi
# Enable 32 bit packages
mbit=('Enabling 32-bit packages' 'Activation des paquets 32 bits')
{
dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get install wget gnupg2 software-properties-common apt-transport-https curl transmission-cli -y
} > /dev/null 2>&1 &
Spinner "${mbit[$languages]}"
# Installing Wine
mwine=('Installing Wine.' 'Installation de Wine.')
{
wget -nc https://dl.winehq.org/wine-builds/winehq.key
apt-key add winehq.key && \
apt-add-repository 'deb https://dl.winehq.org/wine-builds/debian/ buster main'
rm winehq.key
apt update -y
apt install --install-recommends winehq-stable -y
# Add Variables to the environment at the end of ~/.bashrc
echo -e 'export WINEPREFIX=~/.wine\nexport WINEDEBUG=fixme-all\nexport WINEARCH=win64' >> ~/.bashrc
echo -e 'export DISPLAY=:0' >> ~/.bashrc
source ~/.bashrc
winecfg
} > /dev/null 2>&1 &
Spinner "${mwine[$languages]}"
# Dotnet Installation
if [ $dotnet == 'y' ] || [ $dotnet == '' ] || [ $dotnet == 'Y' ] || [ $dotnet == 'o' ] || [ $dotnet == 'O' ] ; then
mdotnet2=('Installing Dotnet.' 'Installation de Dotnet.')
{
#Dotnet Package
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
#Install the SDK
apt-get install -y dotnet-sdk-3.1
apt-get install -y dotnet-sdk-6.0
#Install the runtime
apt-get install -y aspnetcore-runtime-3.1
apt-get install -y aspnetcore-runtime-6.0
} > /dev/null 2>&1 &
Spinner "${mdotnet2[$languages]}"
fi
mbinary=('Game Binary Installation.' 'Installation des fichiers binaires.')
{
# Download plutonium-updater
cd $HOME/T5Server/Plutonium/
wget https://github.com/mxve/plutonium-updater.rs/releases/latest/download/plutonium-updater-x86_64-unknown-linux-gnu.tar.gz
tar xfv plutonium-updater-x86_64-unknown-linux-gnu.tar.gz
rm plutonium-updater-x86_64-unknown-linux-gnu.tar.gz
chmod +x plutonium-updater
# Make executable script
chmod +x $HOME/T5Server/Plutonium/T5Server.sh
chmod +x $HOME/T5Server/Plutonium/T5_mp_server.sh
chmod +x $HOME/T5Server/Plutonium/T5_zm_server.sh
# Download Game File
cd $HOME/T5Server/
wget https://plutonium.pw/pluto_t5_full_game.torrent
tmpfile=$(mktemp)
chmod a+x $tmpfile
echo "killall transmission-cli" > $tmpfile
transmission-cli -f $tmpfile pluto_t5_full_game.torrent -w $HOME/T5Server
# Clean Installation
rm $HOME/T5Server/pluto_t5_full_game.torrent
mv $HOME/T5Server/pluto_t5_full_game $HOME/T5Server/Server
rm -r $HOME/T5Server/Server/redist
rm $HOME/T5Server/README.md
} > /dev/null 2>&1 &
Spinner "${mbinary[$languages]}"
mfinish=('Installation finished.' 'Installation terminee.')
mquit=('ENTER to quit.' 'ENTER pour quitter.')
printf "\n${GREEN}${mfinish[$languages]}${NC}\n"
printf "\n${mquit[$languages]}"
stty -igncr
read
exit