mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
63 lines
2.6 KiB
Bash
Executable file
63 lines
2.6 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
#defaults - change these parameters in /etc/conf.d/plexmediaserver
|
|
export PLEX_MEDIA_SERVER_USER=plex
|
|
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
|
|
export PLEX_MEDIA_SERVER_HOME=/opt/plexmediaserver
|
|
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
|
|
export PLEX_MEDIA_SERVER_TMPDIR=/tmp
|
|
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${PLEX_MEDIA_SERVER_HOME}/Library/Application Support"
|
|
|
|
test -f /etc/conf.d/plexmediaserver && . /etc/conf.d/plexmediaserver
|
|
|
|
#if [ -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ]
|
|
#then
|
|
# chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR"
|
|
# if [ ! $? -eq 0 ]
|
|
# then
|
|
# echo "WARNING COULDN'T CHOWN $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR files to ${PLEX_MEDIA_SERVER_USER}, MAKE SURE I HAVE PERMISSON TO DO THAT!"
|
|
# exit 1
|
|
# fi
|
|
#fi
|
|
|
|
|
|
if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ]
|
|
then
|
|
mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR"
|
|
chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR"
|
|
if [ ! $? -eq 0 ]
|
|
then
|
|
echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR, MAKE SURE I HAVE PERMISSON TO DO THAT!"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/armv5tel/Frameworks/" ]
|
|
then
|
|
mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/armv5tel/Frameworks/"
|
|
chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/armv5tel/Frameworks/"
|
|
if [ ! $? -eq 0 ]
|
|
then
|
|
echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Linux/armv5tel/Frameworks, MAKE SURE I HAVE PERMISSON TO DO THAT!"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs" ]
|
|
then
|
|
mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs"
|
|
chown -R ${PLEX_MEDIA_SERVER_USER} "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs"
|
|
if [ ! $? -eq 0 ]
|
|
then
|
|
echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR/Plex Media Server/Logs, MAKE SURE I HAVE PERMISSON TO DO THAT!"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}"
|
|
export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
|
|
|
|
ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
|
|
|
|
cd ${PLEX_MEDIA_SERVER_HOME}; su -c "${PLEX_MEDIA_SERVER_HOME}/Plex\ Media\ Server &" ${PLEX_MEDIA_SERVER_USER}
|