initial commit
This commit is contained in:
commit
910b438686
19 files changed
+1790
No files matched your search
@@ -0,0 +1 @@
|
||||
/etc/default/terractl
|
||||
@@ -0,0 +1,22 @@
|
||||
Package: terraria-server-manager
|
||||
Version: @VERSION@
|
||||
Section: games
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Installed-Size: @INSTALLED_SIZE@
|
||||
Maintainer: Your Name <you@example.com>
|
||||
Depends: unzip, systemd
|
||||
Recommends: curl, libicu76 | libicu74 | libicu72 | libicu70 | libicu-dev
|
||||
Conflicts: terraria-instance
|
||||
Replaces: terraria-instance
|
||||
Description: run multiple Terraria and tModLoader dedicated servers with systemd
|
||||
Provides the terraria@.service template and the terractl command for
|
||||
running any number of vanilla Terraria and tModLoader dedicated servers, each
|
||||
as its own systemd service under an unprivileged terraria user.
|
||||
.
|
||||
Server software is not included. Place the official server zips in
|
||||
/var/lib/terraria/dist and they are unpacked into each instance on demand.
|
||||
.
|
||||
curl and ICU are only needed for tModLoader instances.
|
||||
.
|
||||
This package replaces terraria-instance (the same tool under its old name).
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
systemd-sysusers terractl.conf
|
||||
systemd-tmpfiles --create terractl.conf
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload || true
|
||||
fi
|
||||
# Running instances are not restarted; they pick up changes on their next start.
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
# Forget which instances were enabled at boot
|
||||
rm -f /etc/systemd/system/multi-user.target.wants/terraria@*.service
|
||||
rm -rf /etc/systemd/system/terraria@.service.d
|
||||
cat >&2 <<MSG
|
||||
terraria-server-manager purged. Worlds and instances in /var/lib/terraria and the
|
||||
'terraria' user were kept. Remove them manually if they are no longer needed:
|
||||
sudo rm -rf /var/lib/terraria && sudo userdel terraria
|
||||
MSG
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
remove|purge)
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload || true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# On removal, stop all instances while the helper script still exists, so each
|
||||
# server is sent "exit" and saves its world. (Without the script, systemd would
|
||||
# just kill them.) Upgrades leave running servers alone.
|
||||
case "$1" in
|
||||
remove|deconfigure)
|
||||
if [ -d /run/systemd/system ]; then
|
||||
units=$(systemctl list-units --plain --no-legend --all 'terraria@*.service' | awk '{print $1}')
|
||||
if [ -n "$units" ]; then
|
||||
echo "Stopping Terraria instances: $units"
|
||||
systemctl stop $units || true
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user