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

26 lines
771 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 \
2017-01-11 20:29:18 +00:00
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
2017-01-11 20:37:30 +00:00
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
echo "Change in ownership detected, please be patient while we chown existing files"
echo "This could take some time"
chown abc:abc -R \
2017-01-11 20:29:18 +00:00
/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" ]] && \
2019-02-15 11:20:18 -08:00
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 \
/config \
/config/*