Skip to content

Commit 8269ead

Browse files
committed
Don't redundantly chown the configuration file, and move the --config-file option to st2 instead of the login subcommand
1 parent de8a668 commit 8269ead

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/st2bootstrap-deb.sh

+4-7
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ configure_st2_cli_config() {
298298
CURRENT_USER_CLI_CONFIG_DIRECTORY="${HOME}/.st2"
299299
CURRENT_USER_CLI_CONFIG_PATH="${CURRENT_USER_CLI_CONFIG_DIRECTORY}/config"
300300

301-
sudo st2 login --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
302-
--write-password \
301+
sudo st2 --config-file ${ROOT_USER_CLI_CONFIG_PATH} \
302+
login --write-password \
303303
--username ${USERNAME} --password ${PASSWORD}
304304

305305
# Write config for root user
@@ -308,12 +308,9 @@ configure_st2_cli_config() {
308308
fi
309309

310310
# Write config for current user (in case current user != root)
311-
st2 login --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
312-
--write-password \
311+
st2 --config-file ${CURRENT_USER_CLI_CONFIG_PATH} \
312+
login --write-password \
313313
--username ${USERNAME} --password ${PASSWORD}
314-
315-
# Fix the permissions
316-
chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY}
317314
}
318315

319316

0 commit comments

Comments
 (0)