This commit is contained in:
wangchuxiao 2023-04-10 19:46:47 +08:00
parent 2409d17892
commit c021922213
2 changed files with 23 additions and 23 deletions

View File

@ -74,37 +74,37 @@ install_docker_compose() {
git checkout errcode git checkout errcode
echo "git clone success" echo "git clone success"
echo "Please enter the data directory, deault is $(pwd), press enter to use default" echo "Please enter the data directory, deault is $(pwd), press enter to use default"
read data_dir read DATA_DIR
is_empyt $data_dir is_empyt $DATA_DIR
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
data_dir="./" DATA_DIR="./"
fi fi
echo "Please enter the user, deault is root, press enter to use default" echo "Please enter the user, deault is root, press enter to use default"
read user read USER
is_empyt $user is_empyt $USER
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
user="root" USER="root"
fi fi
echo "Please enter the password, default is openIM123, press enter to use default" echo "Please enter the password, default is openIM123, press enter to use default"
read password read PASSWORD
is_empyt $password is_empyt $PASSWORD
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
password="openIM123" PASSWORD="openIM123"
fi fi
echo "Please enter the minio_endpoint, default will detect auto, press enter to use default:" echo "Please enter the minio_endpoint, default will detect auto, press enter to use default:"
read minio_endpoint read MINIO_ENDPOINT
is_empyt $minio_endpoint is_empyt $MINIO_ENDPOINT
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
internet_ip=`curl ifconfig.me -s` internet_ip=`curl ifconfig.me -s`
minio_endpoint="http://${internet_ip}:10005" MINIO_ENDPOINT="http://${internet_ip}:10005"
fi fi
export minio_endpoint export MINIO_ENDPOINT
export user export USER
export password export PASSWORD
edit_config edit_config
edit_enterprise_config edit_enterprise_config

View File

@ -1,10 +1,10 @@
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"
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:]]*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:]]*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 sed -i "/\([[:space:]]*endpoint: *\).*/s##\1$MINIO_ENDPOINT#;" ../config/config.yaml
sed -i "/\([[:space:]]*dbPassWord: *\).*/s//\1$password/;" ../config/config.yaml sed -i "/\([[:space:]]*dbPassWord: *\).*/s//\1$PASSWORD/;" ../config/config.yaml
sed -i "/\([[:space:]]*secret: *\).*/s//\1$password/;" ../docker-compose_cfg/config.yaml sed -i "/\([[:space:]]*secret: *\).*/s//\1$PASSWORD/;" ../docker-compose_cfg/config.yaml