Skip to content

Instantly share code, notes, and snippets.

@mtekk
Created February 28, 2014 05:45
Show Gist options
  • Save mtekk/9265948 to your computer and use it in GitHub Desktop.
Save mtekk/9265948 to your computer and use it in GitHub Desktop.
PlexHT init.d script for Gentoo/Funtoo
#!/sbin/runscript
# Released under the 2-clause BSD license.
description="Start and stop Plex Home Theater"
depend()
{
need net
}
start()
{
ebegin "Starting Plex"
export XBMC_HOME=/opt/plexhometheater/share/XBMC/
start-stop-daemon --start -u ${PLEX_USER:-plex} --background --pidfile /var/run/plex.pid --make-pidfile --exec /usr/bin/xinit -- /opt/plexhometheater/bin/plexhometheater ${PLEX_OPTS} -- :0
eend $?
}
stop()
{
ebegin "Stopping Plex"
start-stop-daemon --stop --pidfile /var/run/plex.pid
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment