-
-
Save falonofthetower/0fb8abbabed76cbe6374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need root | |
sudo su - | |
# Install dependancies | |
apt-get -y update && apt-get -y install unzip screen mono-runtime libmono-system-core4.0-cil libmono-sqlite4.0-cil libmysql-cil-dev libmono-system-runtime-serialization4.0-cil libmono-web4.0-cil libmono-system-xml-linq4.0-cil | |
# Add terraria group and user | |
sudo groupadd --gid 70001 terraria | |
sudo useradd --gid 70001 -d /home/terraria -m --uid 70001 -s /bin/bash terraria | |
# Change user to terraria | |
su terraria | |
# Make and change to bin folder | |
mkdir ~/bin | |
cd ~/bin | |
# Download and extract TShock Terraria Server | |
wget https://github.com/NyxStudios/TShock/releases/download/v4.2301/TShock.4.2.3.0720.zip | |
unzip TShock.4.2.3.0720.zip | |
# Fix case-insensitive folder | |
ln -s serverplugins ServerPlugins | |
# Run Terraria for first time, create world | |
# (note down auth code for admin access, and exit-nosave) | |
# mono TerrariaServer.exe -ip 0.0.0.0 -port 7777 -maxplayers 8 | |
# Change server password | |
#TERRARIAPASSWORD="password"; | |
# sed -i "s/("ServerPassword": ")[^"]*(",)$/1${TERRARIAPASSWORD}2/" tshock/config.json | |
# Terraria is now installed, keep reading to setup startup init script | |
# Go back to root | |
exit | |
# Download init script to /etc/init.d/ | |
wget -O /etc/init.d/terraria-server http://www.nooblet.org/blog/download/terraria-init.sh | |
# Fix permissions | |
chmod +x /etc/init.d/terraria-server | |
# Insert to startup | |
insserv -v /etc/init.d/terraria-server | |
# At this point you may want to edit the init script if you are using a | |
# different world-file or server-port | |
# Also by default, the script does not save on exit, see variable: EXIT_COMMAND | |
# Start the server | |
# invoke-rc.d terraria-server start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment