Skip to content

Commit

Permalink
Don't redundantly chown the configuration file, and move the --config…
Browse files Browse the repository at this point in the history
…-file option to st2 instead of the login subcommand
  • Loading branch information
blag committed Jun 21, 2018
1 parent de8a668 commit 8269ead
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/st2bootstrap-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ configure_st2_cli_config() {
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"

sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
--write-password \
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Write config for root user
Expand All @@ -308,12 +308,9 @@ configure_st2_cli_config() {
fi

# Write config for current user (in case current user != root)
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
--write-password \
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
login --write-password \
--username ${USERNAME} --password ${PASSWORD}

# Fix the permissions
chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY}
}


Expand Down

0 comments on commit 8269ead

Please sign in to comment.