chore: move to helper functions for fetching passwords

This commit is contained in:
Jose Diaz-Gonzalez
2019-07-11 16:34:35 -07:00
parent c98705f29d
commit 2b507c6938
3 changed files with 29 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ service-connect-admin-cmd() {
verify_service_name "$SERVICE"
SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
SERVICE_NAME="$(get_service_name "$SERVICE")"
PASSWORD="$(cat "$SERVICE_ROOT/ROOTPASSWORD")"
PASSWORD="$(service_root_password "$SERVICE")"
has_tty && SERVICE_TTY_OPTS="-t"
docker exec -i $SERVICE_TTY_OPTS "$SERVICE_NAME" mongo -u admin -p "$PASSWORD" --authenticationDatabase admin "$SERVICE"