From 738392a19d27c9832273f8939e795086e6e5131a Mon Sep 17 00:00:00 2001 From: Shawn <62177488+lattisimo@users.noreply.github.com> Date: Tue, 6 Oct 2020 16:42:00 -0500 Subject: [PATCH 1/2] account for unique user group use 'id -gn' to get the user group --- scripts/st2bootstrap-el8.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/st2bootstrap-el8.sh b/scripts/st2bootstrap-el8.sh index d286ca97..07ef6735 100644 --- a/scripts/st2bootstrap-el8.sh +++ b/scripts/st2bootstrap-el8.sh @@ -289,6 +289,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -326,7 +327,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R ${CURRENT_USER}:${CURRENT_GROUP} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } From 7389acdd50f70057794614cde7112505255194d2 Mon Sep 17 00:00:00 2001 From: Shawn Robinson Date: Wed, 7 Oct 2020 19:57:08 -0500 Subject: [PATCH 2/2] account for unique user group --- scripts/includes/common.sh | 3 ++- scripts/st2bootstrap-deb.sh | 3 ++- scripts/st2bootstrap-el7.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/includes/common.sh b/scripts/includes/common.sh index 71d25336..dbda10ff 100644 --- a/scripts/includes/common.sh +++ b/scripts/includes/common.sh @@ -174,6 +174,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -211,7 +212,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R ${CURRENT_USER}:${CURRENT_GROUP} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index 03ae4262..dbd1dd47 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -291,6 +291,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -328,7 +329,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R ${CURRENT_USER}:${CURRENT_GROUP} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } diff --git a/scripts/st2bootstrap-el7.sh b/scripts/st2bootstrap-el7.sh index 1b65a0d9..a4cf7d6b 100644 --- a/scripts/st2bootstrap-el7.sh +++ b/scripts/st2bootstrap-el7.sh @@ -285,6 +285,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -322,7 +323,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R ${CURRENT_USER}:${CURRENT_GROUP} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} }