-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_download.sh
32 lines (21 loc) · 912 Bytes
/
1_download.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
#!/bin/bash
set -euo pipefail
#set -euxo pipefail # useful during development
echo "Downloading..."
# Create a temporary folder and download & extract specified server version to it
URL="https://www.terraria.org/api/download/pc-dedicated-server/terraria-server-$DOWNLOAD_VERSION.zip"
echo "URL: $URL"
mkdir -p /terraria/tmp
cd /terraria/tmp
curl -sL $URL --output terraria-server.zip
unzip -oq terraria-server.zip
# Troubleshooting https://terraria.fandom.com/wiki/Server#Troubleshooting
rm */Linux/System.dll
# Copy extracted Linux version and default config files
rm -Rf /terraria/server
mv */Linux /terraria/server
mv */Windows/serverconfig.txt /terraria/server/serverconfig-default.txt
rm -Rf /terraria/tmp/*
chmod +x /terraria/server/TerrariaServer*
if [ ! -f /terraria/server/TerrariaServer ]; then echo "Missing /terraria/server/TerrariaServer executable"; exit 1; fi
echo "Download complete"