fix bug
This commit is contained in:
parent
1a092c8887
commit
4b16f5dde9
@ -29,5 +29,5 @@
|
|||||||
"url": "https://你的域名",
|
"url": "https://你的域名",
|
||||||
"rewriteHost": true
|
"rewriteHost": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
41
install.sh
41
install.sh
@ -27,9 +27,43 @@ install(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_config(){
|
||||||
|
local config_password=$(jq -r '.auth.password' "./config.json")
|
||||||
|
if [ "$config_password" != "你的密码" ]; then
|
||||||
|
local regenerate
|
||||||
|
read -p "检测到配置已存在,是否重新生成配置?(y/n): " regenerate
|
||||||
|
if [ "$regenerate" != "y" ] && [ "$regenerate" != "Y" ]; then
|
||||||
|
echo "取消重新生成配置."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "请选择配置类型:"
|
||||||
|
echo "1. 自签名证书配置"
|
||||||
|
echo "2. tls证书配置"
|
||||||
|
local choice
|
||||||
|
read -p "输入您的选择: " choice
|
||||||
|
case $choice in
|
||||||
|
1)
|
||||||
|
echo "重置为自签名证书配置..."
|
||||||
|
cp ./config_template/self_cert_config.json ./config.json
|
||||||
|
bash ./bin/init.sh
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo "重置为tls证书配置..."
|
||||||
|
cp ./config_template/tls_cert_config.json ./config.json
|
||||||
|
bash ./bin/init_with_tls_cert.sh
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "无效的选择, 请重新选择."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# 显示菜单
|
# 显示菜单
|
||||||
echo "请选择一个操作:"
|
echo "请选择一个操作:"
|
||||||
|
echo "0. 生成配置"
|
||||||
echo "1. 启动容器"
|
echo "1. 启动容器"
|
||||||
echo "2. 查看分享链接"
|
echo "2. 查看分享链接"
|
||||||
echo "3. 停止容器"
|
echo "3. 停止容器"
|
||||||
@ -43,6 +77,10 @@ read -p "输入您的选择: " choice
|
|||||||
|
|
||||||
# 根据用户选择执行相应的操作
|
# 根据用户选择执行相应的操作
|
||||||
case $choice in
|
case $choice in
|
||||||
|
0)
|
||||||
|
echo "重新生成配置.."
|
||||||
|
create_config
|
||||||
|
;;
|
||||||
1)
|
1)
|
||||||
# 启动容器
|
# 启动容器
|
||||||
echo "启动容器.."
|
echo "启动容器.."
|
||||||
@ -79,6 +117,3 @@ case $choice in
|
|||||||
echo "无效的选择, 请重新选择."
|
echo "无效的选择, 请重新选择."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user