docker-plex-wireguard/root/etc/cont-init.d/40-chown-files

26 lines
795 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}"
chown -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"
chown abc:abc -R \
/config/Library
fi
2019-02-15 11:44:27 -05:00
# remove plex pid after unclean stop
[[ -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid" ]] && \
rm -f "/config/Library/Application Support/Plex Media Server/plexmediaserver.pid"
2019-02-15 11:44:27 -05:00
# permissions (non-recursive) on config root and folders
chown abc:abc \
2022-07-18 10:17:18 -04:00
/config \
/config/*