From ab2a1b42dc5b8d75f27be83affa28dc2f0ef23c9 Mon Sep 17 00:00:00 2001 From: ljm42 Date: Fri, 17 Jul 2015 22:14:49 -0700 Subject: [PATCH 1/2] Update 99_chown_plex_owned_files.sh * Fixes conditional in "if" statement * searches for files/groups not owned by "abc" * works on symbolic links (chown -h) --- init/99_chown_plex_owned_files.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init/99_chown_plex_owned_files.sh b/init/99_chown_plex_owned_files.sh index 73f8dae..03c46d3 100644 --- a/init/99_chown_plex_owned_files.sh +++ b/init/99_chown_plex_owned_files.sh @@ -1,6 +1,7 @@ #!/bin/bash -if [ -f /config/Library/Application Support]; then -find "/config/Library/Application Support" -user plex -exec chown abc:abc {} \; -fi \ No newline at end of file +if [ -f "/config/Library/Application Support" ]; then +find "/config/Library/Application Support" \! -user abc -exec chown -h abc:abc {} \; +find "/config/Library/Application Support" \! -group abc -exec chown -h abc:abc {} \; +fi From bf142b17af66b85fd6b6e706eae74e6faecc6fd8 Mon Sep 17 00:00:00 2001 From: ljm42 Date: Fri, 17 Jul 2015 22:32:47 -0700 Subject: [PATCH 2/2] Update 99_chown_plex_owned_files.sh update conditional --- init/99_chown_plex_owned_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/99_chown_plex_owned_files.sh b/init/99_chown_plex_owned_files.sh index 03c46d3..9d754be 100644 --- a/init/99_chown_plex_owned_files.sh +++ b/init/99_chown_plex_owned_files.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ -f "/config/Library/Application Support" ]; then +if [ -d "/config/Library/Application Support" ]; then find "/config/Library/Application Support" \! -user abc -exec chown -h abc:abc {} \; find "/config/Library/Application Support" \! -group abc -exec chown -h abc:abc {} \; fi