Skip to content

Commit 8c4bcb7

Browse files
authored
Condense the ownership check
1 parent ac7bb65 commit 8c4bcb7

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

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

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

3-
# check for preferences file and if not found, exit out
4-
if [ ! -e "/config/Library/Application Support/Plex Media Server/Preferences.xml" ]; then
3+
# check for Library existence and permissions
4+
if [ ! -d "/config/Library" ]; then
55
mkdir -p /config/Library
6-
chown abc:abc \
7-
/config/Library
8-
exit 0
9-
fi
10-
11-
if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
6+
chown abc:abc /config/Library
7+
elif [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
128
echo "Change in ownership detected, please be patient while we chown existing files"
139
echo "This could take some time"
1410
chown abc:abc -R \

0 commit comments

Comments
 (0)