diff --git a/init/11_new_user.sh b/init/11_new_user.sh index b5ac305..9d0cf40 100644 --- a/init/11_new_user.sh +++ b/init/11_new_user.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ "$(id -u abc)" != "$PUID" ]; then usermod -o -u "$PUID" abc ; fi -if [ "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi +if [ -n "$PUID" -a "$(id -u abc)" != "$PUID" ]; then usermod -o -u "$PUID" abc ; fi +if [ -n "$PGID" -a "$(id -g abc)" != "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi echo " ----------------------------------- diff --git a/init/99_chown_plex_owned_files.sh b/init/99_chown_plex_owned_files.sh index 66a976e..f7d37fc 100644 --- a/init/99_chown_plex_owned_files.sh +++ b/init/99_chown_plex_owned_files.sh @@ -2,6 +2,9 @@ if [ -d "/config/Library" ]; then -find /config/Library ! \( -user abc -a -group abc \) -exec chown -hv abc:abc {} \; +find /config/Library ! \( -user abc -a -group abc \) -exec chown -hv abc:abc {} + +else +mkdir /config/Library +chown abc:abc /config/Library fi