Skip to content

Commit dc8483e

Browse files
authored
Merge pull request #79 from linuxserver/chown-fix
perform ownership check on /config, chown if necessary
2 parents 6831ab3 + 8c4bcb7 commit dc8483e

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

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

3-
# check for preferences file, make lock file if not found and exit out
4-
if [ ! -e "/config/Library/Application Support/Plex Media Server/Preferences.xml" ]; then
5-
mkdir -p /config/Library
6-
touch /config/Library/linuxserver-chown.lock
7-
chown abc:abc \
3+
# check for Library existence and permissions
4+
if [ ! -d "/config/Library" ]; then
5+
mkdir -p /config/Library
6+
chown abc:abc /config/Library
7+
elif [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
8+
echo "Change in ownership detected, please be patient while we chown existing files"
9+
echo "This could take some time"
10+
chown abc:abc -R \
811
/config/Library
9-
chown abc:abc \
10-
/config/Library/linuxserver-chown.lock
11-
exit 0
12-
fi
13-
14-
if [ ! -f "/config/Library/linuxserver-chown.lock" ]; then
15-
echo "Possible migration from existing version detected, please be patient while we chown existing files"
16-
echo "This could take some time"
17-
chown abc:abc -R \
18-
/config/Library
19-
touch /config/Library/linuxserver-chown.lock
20-
chown abc:abc \
21-
/config/Library/linuxserver-chown.lock
22-
echo "chown operation completed"
2312
fi

0 commit comments

Comments
 (0)