#!/bin/sh # Runs Titano Server as PUID:PGID (Unraid/NAS convention). /data is owned by that user; /archive is left as # mounted (it may hold terabytes) and only checked for write access. set -eu PUID="${PUID:-1000}" PGID="${PGID:-1000}" umask 002 if [ "$(id -u)" = "0" ]; then mkdir -p /data chown -R "$PUID:$PGID" /data if ! setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- test -w "${TITANO_ARCHIVE_PATH:-/archive}"; then echo "warning: ${TITANO_ARCHIVE_PATH:-/archive} is not writable by $PUID:$PGID" >&2 fi exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Titano.Server.dll "$@" fi exec dotnet /app/Titano.Server.dll "$@"