Skip to content

Commit 85caabf

Browse files
committed
different approach to init
1 parent 894d4b7 commit 85caabf

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

root/etc/cont-init.d/40-chown-files

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/usr/bin/with-contenv bash
22

3-
# check for Library existence and permissions
4-
if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then
5-
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
6-
chown abc:abc "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
7-
elif [ ! "$(stat -c %u "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}")" = "$PUID" ]; then
3+
# create folders
4+
if [[ ! -d ${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR} ]]; then \
5+
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
6+
chown -R abc:abc "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
7+
fi
8+
9+
# check Library permissions
10+
PUID=${PUID:-911}
11+
if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
812
echo "Change in ownership detected, please be patient while we chown existing files"
913
echo "This could take some time"
1014
chown abc:abc -R \
11-
"${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
15+
/config/Library
1216
fi
1317

14-
chown abc:abc \
15-
/config \
16-
/config/*

0 commit comments

Comments
 (0)