Skip to content

Commit a9b9a12

Browse files
authored
enable ownership check on /config
1 parent 6831ab3 commit a9b9a12

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

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

3-
# check for preferences file, make lock file if not found and exit out
3+
# check for preferences file and if not found, exit out
44
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 \
5+
mkdir -p /config/Library
6+
chown abc:abc \
87
/config/Library
9-
chown abc:abc \
10-
/config/Library/linuxserver-chown.lock
11-
exit 0
8+
exit 0
129
fi
1310

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 \
11+
if [ ! `stat -c %U /config/Library` = "abc" ]; then
12+
echo "Change in ownership detected, please be patient while we chown existing files"
13+
echo "This could take some time"
14+
chown abc:abc -R \
1815
/config/Library
19-
touch /config/Library/linuxserver-chown.lock
20-
chown abc:abc \
21-
/config/Library/linuxserver-chown.lock
22-
echo "chown operation completed"
2316
fi

0 commit comments

Comments
 (0)