docker-plex-wireguard/root/etc/s6-overlay/s6-rc.d/init-plex-chown/run
Eric Nemchik b046c3ffb4
Replace existing chown with lsiown
Signed-off-by: Eric Nemchik <eric@nemchik.com>
2024-01-08 20:02:48 -06:00

26 lines
809 B
Text
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/with-contenv bash
# create folders
if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then \
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
lsiown -R abc:abc /config
fi
# check Library permissions
PUID=${PUID:-911}
if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
echo "Change in ownership detected, please be patient while we chown existing files"
echo "This could take some time"
lsiown abc:abc -R \
/config/Library
fi
# 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
# permissions (non-recursive) on config root and folders
lsiown abc:abc \
/config \
/config/*