From 5cacb421450d963a30f69ecf40ff437c35e3da49 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 15 Jul 2015 17:53:00 +0000
Subject: runit-scripts: add plexmediaserver

---
 abs/core/runit-scripts/PKGBUILD                      |  2 +-
 .../runitscripts/services/plexmediaserver/run        | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100755 abs/core/runit-scripts/runitscripts/services/plexmediaserver/run

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index 798e3fd..d257ffe 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=8.3
-pkgrel=8
+pkgrel=9
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runitscripts/services/plexmediaserver/run b/abs/core/runit-scripts/runitscripts/services/plexmediaserver/run
new file mode 100755
index 0000000..6d0b04e
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/plexmediaserver/run
@@ -0,0 +1,20 @@
+#!/bin/sh
+exec 2>&1
+export TERM=linux
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/plexmediaserver
+. /etc/locale.conf
+
+stat_runit "Starting Plex Media Server"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
+export PLEX_MEDIA_SERVER_HOME="${PLEX_MEDIA_SERVER_HOME}"
+export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
+export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="${PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS}"
+export PLEX_MEDIA_SERVER_TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
+export TMPDIR="${TMPDIR}"
+export LC_ALL="${LANG}"
+export LANG="${LANG}"
+ulimit -s 3000
+
+exec chpst -uplex:plex /opt/plexmediaserver/Plex\ Media\ Server
-- 
cgit v0.12

