update
This commit is contained in:
parent
796ac78f05
commit
f1f54ce1b5
32
install.sh
32
install.sh
@ -6,9 +6,35 @@ restart_docker(){
|
||||
docker-compose -f ./docker-compose.yml up -d
|
||||
}
|
||||
|
||||
|
||||
change_reality_dest(){
|
||||
local config_dir="./conf"
|
||||
|
||||
if [ ! -e "$config_dir/config.json" ] || [ ! -s "$config_dir/config.json" ];then
|
||||
echo "请先'创建配置'"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
source ./bin/utils/jq_util.sh
|
||||
|
||||
# 输入dest值
|
||||
local old_dest=$(jq -r '.inbounds[0].streamSettings.realitySettings.dest' "$config_dir/config.json")
|
||||
local dest
|
||||
read -p "请输入新的dest地址[当前地址: $old_dest]: " dest
|
||||
|
||||
local domain=$(echo "$dest" | awk -F ':' '{print $1}')
|
||||
|
||||
sed -i "s/你的reality_dest/$domain/g" "$config_dir/config.json"
|
||||
|
||||
echo "配置文件修改realty_dest成功!"
|
||||
echo "新的dest地址为: $dest"
|
||||
echo "新的serverNames数组为: [\"$domain\"]"
|
||||
}
|
||||
|
||||
main(){
|
||||
# 显示菜单
|
||||
echo "请选择一个操作:"
|
||||
echo "0. 创建配置 / 重置配置"
|
||||
echo "1. 启动容器"
|
||||
echo "2. 查看分享链接"
|
||||
echo "3. 停止容器"
|
||||
@ -22,6 +48,10 @@ main(){
|
||||
|
||||
# 根据用户选择执行相应的操作
|
||||
case $choice in
|
||||
0)
|
||||
# 创建配置 / 重置配置
|
||||
bash ./bin/create_config.sh
|
||||
;;
|
||||
1)
|
||||
# 启动容器
|
||||
echo "启动容器.."
|
||||
@ -48,7 +78,7 @@ main(){
|
||||
;;
|
||||
6)
|
||||
# 修改Reality目标域名
|
||||
bash ./bin/update_reality_dest.sh
|
||||
change_reality_dest
|
||||
restart_docker
|
||||
;;
|
||||
0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user