mirror of
https://github.com/akatsukiro/lsky-pro-install-script.git
synced 2025-06-08 05:53:04 +08:00
feat: 全自动安装 配置数据库部分
This commit is contained in:
parent
2e1b528888
commit
acf1704349
27
install.sh
27
install.sh
@ -236,21 +236,26 @@ install_maraidb
|
|||||||
setup_database() {
|
setup_database() {
|
||||||
echo -e "${green}开始配置数据库${plain}"
|
echo -e "${green}开始配置数据库${plain}"
|
||||||
echo -e "${yellow}请无比妥善保存以下信息${plain}"
|
echo -e "${yellow}请无比妥善保存以下信息${plain}"
|
||||||
echo "自动生成数据库信息请输入1,手动输入请输入2,其他情况自动生成"
|
if [[autoFlag == "0" ]]
|
||||||
read -e -r -p "请输入您的选择: " dbFlag
|
echo "自动生成数据库信息请输入1,手动输入请输入2,其他情况自动生成"
|
||||||
if [[ $dbFlag == "1" ]]; then
|
read -e -r -p "请输入您的选择: " dbFlag
|
||||||
db_user="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
|
if [[ $dbFlag == "1" ]]; then
|
||||||
db_name="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
|
db_user="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)"
|
db_name="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
|
||||||
elif [[ $dbFlag == "2" ]]; then
|
db_password="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
|
||||||
read -e -r -p "请输入数据库用户名: " db_user
|
elif [[ $dbFlag == "2" ]]; then
|
||||||
read -e -r -p "请输入数据库名称: " db_name
|
read -e -r -p "请输入数据库用户名: " db_user
|
||||||
read -e -r -p "请输入数据库密码: " db_password
|
read -e -r -p "请输入数据库名称: " db_name
|
||||||
|
read -e -r -p "请输入数据库密码: " db_password
|
||||||
|
else
|
||||||
|
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
|
||||||
else
|
else
|
||||||
db_user="lsky_$(openssl rand -base64 12 | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
|
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_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)"
|
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_user}${plain}"
|
||||||
echo -e "${yellow}数据库名称: ${db_name}${plain}"
|
echo -e "${yellow}数据库名称: ${db_name}${plain}"
|
||||||
echo -e "${yellow}数据库密码: ${db_password}${plain}"
|
echo -e "${yellow}数据库密码: ${db_password}${plain}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user