forked from q3defrag/defrag-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
49 lines (37 loc) · 1.45 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
#!/bin/bash
apt update -y
apt upgrade -y
# Will be needed later
apt install -y unzip unionfs-fuse python3-lxml
# Create the directory structure
[[ -d defrag-base ]] || mkdir defrag-base
[[ -d defrag-maps ]] || mkdir defrag-maps
[[ -d proxymod-base ]] || mkdir -p proxymod-base/defrag/
[[ -d quake3-base ]] || mkdir -p quake3-base/baseq3
[[ -d servers ]] || mkdir -p servers/mount
# Determine the latest version of DeFRaG mod available
#TODO remove --no-check-certificate when cgg adds autorenew for certbot
DEFRAG_MOD_URL=$(cd /tmp/ && wget --spider -r --no-parent --no-check-certificate https://q3defrag.org/files/defrag/ 2>&1 | grep -E "\-\-2" | grep "defrag_" | grep -v "beta" | cut -d' ' -f4 | sort | tail -n1)
# Download the latest version of DeFRaG mod
#TODO remove --insecure when NM adds autorenew for certbot
curl --insecure $DEFRAG_MOD_URL > defrag-base/defrag.zip
# Unzip DeFRaG mod
cd defrag-base
unzip -o defrag.zip
# Cleanup
rm defrag.zip
cd -
# Clone Quake3e by Cyrax, q3e is the fastest engine for q3 dedi server
[[ -d Quake3e ]] || git clone https://github.com/ec-/Quake3e.git
# Install required packages for building Quake3e
apt install -y make gcc build-essential libcurl4-openssl-dev
# Build Quake3e dedicated server only, omit client.
cd Quake3e
make clean
make BUILD_CLIENT=0
# Cleanup
cd -
# Copy over the Quake3e binary
cp Quake3e/build/release-linux-x86/quake3e.ded quake3-base/quake3e.ded
# Remove unused packages at the end
apt autoremove -y