diff --git a/scripts/includes/common.sh b/scripts/includes/common.sh index 2279e54e..d98271a9 100644 --- a/scripts/includes/common.sh +++ b/scripts/includes/common.sh @@ -171,6 +171,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_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -208,7 +209,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_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index ebdd561e..3df9904b 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -288,6 +288,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_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -325,7 +326,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_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } diff --git a/scripts/st2bootstrap-el6.sh b/scripts/st2bootstrap-el6.sh index dcde3d49..d2aa5210 100644 --- a/scripts/st2bootstrap-el6.sh +++ b/scripts/st2bootstrap-el6.sh @@ -283,6 +283,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_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -320,7 +321,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_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } diff --git a/scripts/st2bootstrap-el7.sh b/scripts/st2bootstrap-el7.sh index 07eb2715..133e715f 100644 --- a/scripts/st2bootstrap-el7.sh +++ b/scripts/st2bootstrap-el7.sh @@ -283,6 +283,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_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -320,7 +321,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_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} }