Update init_pwd.sh

pull/461/head
skiffer-git 1 year ago committed by GitHub
parent b44c895d12
commit 4e66f4d237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,11 +1,31 @@
source ../.env
echo "your user is:$USER" echo "your user is:$USER"
echo "your password is:$PASSWORD" echo "your password is:$PASSWORD"
echo "your minio endPoint is:$MINIO_ENDPOINT" echo "your minio endPoint is:$MINIO_ENDPOINT"
echo "your data dir is $DATA_DIR" echo "your data dir is $DATA_DIR"
sed -i "/^\([[:space:]]*dbMysqlUserName: *\).*/s//\1$USER/;0,/\([[:space:]]*dbUserName: *\).*/s//\1 $USER/;/\([[:space:]]*accessKeyID: *\).*/s//\1 $USER/;/\([[:space:]]*endpoint: *\).*/s//\1\"abc\"/;" ../config/config.yaml
sed -i "/^\([[:space:]]*dbMysqlPassword: *\).*/s//\1$PASSWORD/;/\([[:space:]]*dbPassword: *\).*/s//\1$PASSWORD/;/\([[:space:]]*secret: *\).*/s//\1$PASSWORD/;/\([[:space:]]*secretAccessKey: *\).*/s//\1$PASSWORD/;" ../config/config.yaml
sed -i "/\([[:space:]]*endpoint: *\).*/s##\1$MINIO_ENDPOINT#;" ../config/config.yaml #!/bin/bash
sed -i "/\([[:space:]]*dbPassWord: *\).*/s//\1$PASSWORD/;" ../config/config.yaml
sed -i "/\([[:space:]]*secret: *\).*/s//\1$PASSWORD/;" ../.docker-compose_cfg/config.yaml # Specify the config file
config_file='../config/config.yaml'
# Load variables from .env file
source ../.env
# Replace the password and username field for mysql
sed -i "/mysql:/,/database:/ s/password:.*/password: $PASSWORD/" $config_file
sed -i "/mysql:/,/database:/ s/username:.*/username: $USER/" $config_file
# Replace the password and username field for mongo
sed -i "/mongo:/,/maxPoolSize:/ s/password:.*/password: $PASSWORD/" $config_file
sed -i "/mongo:/,/maxPoolSize:/ s/username:.*/username: $USER/" $config_file
# Replace the password field for redis
sed -i '/redis:/,/password:/s/password: .*/password: '${PASSWORD}'/' $config_file
# Replace accessKeyID and secretAccessKey for minio
sed -i "/minio:/,/isDistributedMod:/ s/accessKeyID:.*/accessKeyID: $USER/" $config_file
sed -i "/minio:/,/isDistributedMod:/ s/secretAccessKey:.*/secretAccessKey: $PASSWORD/" $config_file
sed -i '/minio:/,/endpoint:/s|endpoint: .*|endpoint: '${MINIO_ENDPOINT}'|' $config_file

Loading…
Cancel
Save