fix: 全自动安装 在设置数据库部分的代码错误

This commit is contained in:
Akatsukiro 2024-04-21 12:52:45 +08:00
parent acf1704349
commit 5d4b3cdd6c
Signed by: Akatsukiro
GPG Key ID: 93F1D32999999999

View File

@ -236,7 +236,7 @@ install_maraidb
setup_database() {
echo -e "${green}开始配置数据库${plain}"
echo -e "${yellow}请无比妥善保存以下信息${plain}"
if [[autoFlag == "0" ]]
if [[ $autoFlag == "0" ]]; then
echo "自动生成数据库信息请输入1手动输入请输入2其他情况自动生成"
read -e -r -p "请输入您的选择: " dbFlag
if [[ $dbFlag == "1" ]]; then
@ -256,6 +256,7 @@ setup_database() {
db_user="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
db_name="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
db_password="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
fi
echo -e "${yellow}数据库用户名: ${db_user}${plain}"
echo -e "${yellow}数据库名称: ${db_name}${plain}"
echo -e "${yellow}数据库密码: ${db_password}${plain}"