void-packages/srcpkgs/plex-media-server/files/start_pms

29 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Set identification variables
. /etc/os-release
export PLEX_MEDIA_SERVER_INFO_VENDOR="${NAME}"
export PLEX_MEDIA_SERVER_INFO_DEVICE="PC"
export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(date +%Y.%m.%d)
# change these parameters in /etc/default/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver"
export PLEX_MEDIA_SERVER_TMPDIR="/tmp"
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/plexmediaserver"
test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || mkdir "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
test -e /etc/default/plexmediaserver && . /etc/default/plexmediaserver
export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}/lib:${PLEX_MEDIA_SERVER_HOME}"
export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
(
printf 'Starting "Plex Media Server" on %s (%s, %s)\n' "${PLEX_MEDIA_SERVER_INFO_VENDOR}" "${PLEX_MEDIA_SERVER_INFO_MODEL}" "${PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION}"
test -n "${PLEX_MEDIA_SERVER_MAX_STACK_SIZE}" && ulimit -s "${PLEX_MEDIA_SERVER_MAX_STACK_SIZE}"
test -n "${PLEX_MEDIA_SERVER_MAX_VIRTUAL_MEMORY}" && ulimit -v "${PLEX_MEDIA_SERVER_MAX_VIRTUAL_MEMORY}"
cd "${PLEX_MEDIA_SERVER_HOME}" && ./Plex\ Media\ Server
)