增加生成short_id的功能,并更新config.json文件
This commit is contained in:
@@ -9,6 +9,9 @@ create_reality_config(){
|
|||||||
# 生成uui, 写入到config.json文件
|
# 生成uui, 写入到config.json文件
|
||||||
update_uuid
|
update_uuid
|
||||||
|
|
||||||
|
# 生成shor_id, 写入到config.json文件
|
||||||
|
update_short_id
|
||||||
|
|
||||||
# 生成密钥对, 修改config.json中的密钥属性
|
# 生成密钥对, 修改config.json中的密钥属性
|
||||||
update_key
|
update_key
|
||||||
|
|
||||||
@@ -30,6 +33,9 @@ create_xhttp_reality_config(){
|
|||||||
# 生成uuid, 写入到config.json文件
|
# 生成uuid, 写入到config.json文件
|
||||||
update_uuid
|
update_uuid
|
||||||
|
|
||||||
|
# 生成shor_id, 写入到config.json文件
|
||||||
|
update_short_id
|
||||||
|
|
||||||
# 生成密钥对, 修改config.json中的密钥属性
|
# 生成密钥对, 修改config.json中的密钥属性
|
||||||
update_key
|
update_key
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
update_short_id(){
|
||||||
|
|
||||||
|
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件绝对路径
|
||||||
|
local config_dir="$script_dir/../conf"
|
||||||
|
|
||||||
|
# 生成 shortId
|
||||||
|
local short_id=$(openssl rand -hex 8)
|
||||||
|
|
||||||
|
#修改 shortId
|
||||||
|
modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realitySettings.shortIds[0]" "$short_id"
|
||||||
|
|
||||||
|
echo "设置shortId成功."
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user