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} } 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} }