docker-plex-wireguard/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run

27 lines
809 B
Text
Raw Normal View History

#!/usr/bin/with-contenv bash
2017-01-11 20:29:18 +00:00
# create folders
2017-01-11 20:37:30 +00:00
if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then \
2022-07-18 10:17:18 -04:00
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
lsiown -R abc:abc /config
2017-01-11 20:29:18 +00:00
fi
# check Library permissions
PUID=${PUID:-911}
if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
2022-07-18 10:17:18 -04:00
echo "Change in ownership detected, please be patient while we chown existing files"
echo "This could take some time"
lsiown abc:abc -R \
2022-07-18 10:17:18 -04:00
/config/Library
fi
2019-02-15 11:44:27 -05:00
# remove plex pid after unclean stop
if [[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" ]]; then
rm -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid"
fi
2019-02-15 11:44:27 -05:00
# permissions (non-recursive) on config root and folders
lsiown abc:abc \
2022-07-18 10:17:18 -04:00
/config \
/config/*