Files
terraria-server-manager/packaging/deb/postrm
T
adamandClaude Opus 5.5 fc2c08d47b
release / deb (push) Successful in 17s
add doctor, scheduled backups and fetch; release 0.0.12
- doctor [<name>] [--fix]: checks the system (user, programs, folders,
  zips, units and leftover copies in /etc, sandbox access to moved
  folders, journal, polkit, daemon, orphaned boot links and schedules)
  and each instance (ownership, server zip, config paths, mods, ports,
  failed starts/backups), with a fix for each. --fix applies the safe
  ones and re-checks them.
- backup enable|disable|now|list: a systemd timer per instance
  (terraria-backup@.timer, Persistent=), saving the world first, into
  /var/lib/terraria/backups/<name>/ (group-readable), pruning only
  scheduled backups. rename carries the schedule, delete removes it.
  upgrade's backups move there too.
- fetch vanilla|tmodloader [<version>] [--list] [--upgrade <name>]:
  downloads from terraria.org / tModLoader's GitHub releases, checks
  GitHub's sha256 and the zip, names it with its version.
- terractld may write /etc/systemd/system, for backup enable and
  doctor --fix over --host.
- Units, tmpfiles, packaging, completion, docs and changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 22:26:56 +00:00

32 lines
1.1 KiB
Bash
Executable File

#!/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
# Scheduled backups (the backups themselves stay in /var/lib/terraria/backups)
rm -f /etc/systemd/system/timers.target.wants/terraria-backup@*.timer
rm -rf /etc/systemd/system/terraria-backup@*.timer.d /etc/systemd/system/terraria-backup@*.service.d
# The daemon: whether it's on, its certificate and the computers it trusts
rm -f /etc/systemd/system/multi-user.target.wants/terractld.service
rm -rf /etc/systemd/system/terractld.service.d /var/lib/terractl
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