From 7b32e0dcd329a7db14664a694924d81eb1bb3459 Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Tue, 29 Nov 2016 15:49:25 -0800 Subject: [PATCH] Set user and group when creating directories with installer --- extras/installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/installer.sh b/extras/installer.sh index 9ba1c44..d241edb 100755 --- a/extras/installer.sh +++ b/extras/installer.sh @@ -110,12 +110,12 @@ install_plexupdate() { echo -n "'$FULL_PATH' doesn't exist, attempting to create... " if ! mkdir -p "$FULL_PATH" 2>/dev/null; then sudo mkdir -p "$FULL_PATH" || abort "failed, cannot continue" - sudo chown $(whoami) "$FULL_PATH" || abort "failed, cannot continue" + sudo chown $(id -un):$(id -gn) "$FULL_PATH" || abort "failed, cannot continue" fi echo "done" elif [ ! -w "$FULL_PATH" ]; then echo -n "'$FULL_PATH' exists, but you don't have permission to write to it. Changing owner... " - sudo chown $(whoami) "$FULL_PATH" || abort "failed, cannot continue" + sudo chown $(id -un):$(id -gn) "$FULL_PATH" || abort "failed, cannot continue" echo "done" fi