mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 添加、删除用户时同步至singbox下的tuic、hysteria2
parent
4da680012f
commit
875685fb2f
137
install.sh
137
install.sh
|
@ -317,6 +317,7 @@ readCustomPort() {
|
||||||
readInstallType() {
|
readInstallType() {
|
||||||
coreInstallType=
|
coreInstallType=
|
||||||
configPath=
|
configPath=
|
||||||
|
singBoxConfigPath=
|
||||||
|
|
||||||
# 1.检测安装目录
|
# 1.检测安装目录
|
||||||
if [[ -d "/etc/v2ray-agent" ]]; then
|
if [[ -d "/etc/v2ray-agent" ]]; then
|
||||||
|
@ -357,7 +358,7 @@ readInstallType() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "/etc/v2ray-agent/sing-box" && -f "/etc/v2ray-agent/sing-box/sing-box" ]]; then
|
if [[ -d "/etc/v2ray-agent/sing-box" && -f "/etc/v2ray-agent/sing-box/sing-box" ]]; then
|
||||||
if [[ -d "/etc/v2ray-agent/sing-box/conf" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]]; then
|
if [[ -d "/etc/v2ray-agent/sing-box/conf" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config/tuic.json" || -f "/etc/v2ray-agent/sing-box/conf/config/hysteria2.json" ]]; then
|
||||||
singBoxConfigPath=/etc/v2ray-agent/sing-box/conf/
|
singBoxConfigPath=/etc/v2ray-agent/sing-box/conf/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -402,11 +403,9 @@ readInstallProtocolType() {
|
||||||
|
|
||||||
done < <(find ${configPath} -name "*inbounds.json" | awk -F "[.]" '{print $1}')
|
done < <(find ${configPath} -name "*inbounds.json" | awk -F "[.]" '{print $1}')
|
||||||
|
|
||||||
# if [[ -n "${hysteriaConfigPath}" ]]; then
|
|
||||||
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'hysteria2' </etc/v2ray-agent/sing-box/conf/config.json; then
|
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'hysteria2' </etc/v2ray-agent/sing-box/conf/config.json; then
|
||||||
currentInstallProtocolType=${currentInstallProtocolType}'6'
|
currentInstallProtocolType=${currentInstallProtocolType}'6'
|
||||||
fi
|
fi
|
||||||
# if [[ -n "${tuicConfigPath}" ]]; then
|
|
||||||
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'tuic' </etc/v2ray-agent/sing-box/conf/config.json; then
|
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'tuic' </etc/v2ray-agent/sing-box/conf/config.json; then
|
||||||
currentInstallProtocolType=${currentInstallProtocolType}'9'
|
currentInstallProtocolType=${currentInstallProtocolType}'9'
|
||||||
fi
|
fi
|
||||||
|
@ -576,14 +575,14 @@ unInstallSingBox() {
|
||||||
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]]; then
|
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]]; then
|
||||||
if grep -q 'tuic' </etc/v2ray-agent/sing-box/conf/config.json && [[ "${type}" == "tuic" ]]; then
|
if grep -q 'tuic' </etc/v2ray-agent/sing-box/conf/config.json && [[ "${type}" == "tuic" ]]; then
|
||||||
rm "${singBoxConfigPath}config/tuic.json"
|
rm "${singBoxConfigPath}config/tuic.json"
|
||||||
echoContent yellow " ---> 删除sing-box tuic配置成功"
|
echoContent green " ---> 删除sing-box tuic配置成功"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -q 'hysteria2' </etc/v2ray-agent/sing-box/conf/config.json && [[ "${type}" == "hysteria2" ]]; then
|
if grep -q 'hysteria2' </etc/v2ray-agent/sing-box/conf/config.json && [[ "${type}" == "hysteria2" ]]; then
|
||||||
rm "${singBoxConfigPath}config/hysteria2.json"
|
rm "${singBoxConfigPath}config/hysteria2.json"
|
||||||
echoContent yellow " ---> 删除sing-box hysteria2配置成功"
|
echoContent green " ---> 删除sing-box hysteria2配置成功"
|
||||||
fi
|
fi
|
||||||
singBoxMergeConfig
|
rm "${singBoxConfigPath}config.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
readInstallType
|
readInstallType
|
||||||
|
@ -2564,6 +2563,7 @@ handleTuic() {
|
||||||
# shellcheck disable=SC2010
|
# shellcheck disable=SC2010
|
||||||
if find /bin /usr/bin | grep -q systemctl && ls /etc/systemd/system/ | grep -q tuic.service; then
|
if find /bin /usr/bin | grep -q systemctl && ls /etc/systemd/system/ | grep -q tuic.service; then
|
||||||
if [[ -z $(pgrep -f "tuic/tuic") ]] && [[ "$1" == "start" ]]; then
|
if [[ -z $(pgrep -f "tuic/tuic") ]] && [[ "$1" == "start" ]]; then
|
||||||
|
singBoxMergeConfig
|
||||||
systemctl start tuic.service
|
systemctl start tuic.service
|
||||||
elif [[ -n $(pgrep -f "tuic/tuic") ]] && [[ "$1" == "stop" ]]; then
|
elif [[ -n $(pgrep -f "tuic/tuic") ]] && [[ "$1" == "stop" ]]; then
|
||||||
systemctl stop tuic.service
|
systemctl stop tuic.service
|
||||||
|
@ -2595,6 +2595,7 @@ handleSingBox() {
|
||||||
# shellcheck disable=SC2010
|
# shellcheck disable=SC2010
|
||||||
if find /bin /usr/bin | grep -q systemctl && ls /etc/systemd/system/ | grep -q sing-box.service; then
|
if find /bin /usr/bin | grep -q systemctl && ls /etc/systemd/system/ | grep -q sing-box.service; then
|
||||||
if [[ -z $(pgrep -f "sing-box") ]] && [[ "$1" == "start" ]]; then
|
if [[ -z $(pgrep -f "sing-box") ]] && [[ "$1" == "start" ]]; then
|
||||||
|
singBoxMergeConfig
|
||||||
systemctl start sing-box.service
|
systemctl start sing-box.service
|
||||||
elif [[ -n $(pgrep -f "sing-box") ]] && [[ "$1" == "stop" ]]; then
|
elif [[ -n $(pgrep -f "sing-box") ]] && [[ "$1" == "stop" ]]; then
|
||||||
systemctl stop sing-box.service
|
systemctl stop sing-box.service
|
||||||
|
@ -3149,6 +3150,51 @@ initSingBoxTuicConfig() {
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 初始化sing-box socks5 出站
|
||||||
|
initSingBoxSocks5OutboundsConfig() {
|
||||||
|
local uuid=
|
||||||
|
uuid=$(/etc/v2ray-agent/xray/xray uuid)
|
||||||
|
cat <<EOF >/etc/v2ray-agent/sing-box/conf/config/socks5_outbounds.json
|
||||||
|
{
|
||||||
|
"outbounds": [
|
||||||
|
{
|
||||||
|
"type": "socks",
|
||||||
|
"tag": "singBoxSocks5Out",
|
||||||
|
"version": "5",
|
||||||
|
"server":"127.0.0.1",
|
||||||
|
"server_port":31295,
|
||||||
|
"username": "singBox_socks5_outbound",
|
||||||
|
"password": "${uuid}",
|
||||||
|
"network":"udp"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF >${configPath}/02_socks_inbounds_singbox.json
|
||||||
|
{
|
||||||
|
"inbounds": [
|
||||||
|
{
|
||||||
|
"listen": "127.0.0.1",
|
||||||
|
"port": 31295,
|
||||||
|
"protocol": "Socks",
|
||||||
|
"tag": "socksSingBoxOutbound",
|
||||||
|
"settings": {
|
||||||
|
"auth": "password",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"user": "singBox_socks5_outbound",
|
||||||
|
"pass": "${uuid}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"udp": true,
|
||||||
|
"ip": "127.0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
}
|
||||||
# 初始化 sing-box Hysteria2 配置
|
# 初始化 sing-box Hysteria2 配置
|
||||||
initSingBoxHysteria2Config() {
|
initSingBoxHysteria2Config() {
|
||||||
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化Hysteria2配置"
|
echoContent skyBlue "\n进度 $1/${totalProgress} : 初始化Hysteria2配置"
|
||||||
|
@ -3175,6 +3221,7 @@ initSingBoxHysteria2Config() {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
# initSingBoxSocks5OutboundsConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
# sing-box Tuic安装
|
# sing-box Tuic安装
|
||||||
|
@ -3187,7 +3234,6 @@ singBoxTuicInstall() {
|
||||||
# installTuic 1
|
# installTuic 1
|
||||||
installSingBox 1
|
installSingBox 1
|
||||||
initSingBoxTuicConfig 2
|
initSingBoxTuicConfig 2
|
||||||
singBoxMergeConfig
|
|
||||||
installSingBoxService 3
|
installSingBoxService 3
|
||||||
reloadCore
|
reloadCore
|
||||||
showAccounts 4
|
showAccounts 4
|
||||||
|
@ -3202,7 +3248,6 @@ singBoxHysteria2Install() {
|
||||||
totalProgress=5
|
totalProgress=5
|
||||||
installSingBox 1
|
installSingBox 1
|
||||||
initSingBoxHysteria2Config 2
|
initSingBoxHysteria2Config 2
|
||||||
singBoxMergeConfig
|
|
||||||
installSingBoxService 3
|
installSingBoxService 3
|
||||||
reloadCore
|
reloadCore
|
||||||
showAccounts 4
|
showAccounts 4
|
||||||
|
@ -5048,7 +5093,7 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# VLESS TCP
|
# VLESS TCP
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "0"; then
|
if echo "${currentInstallProtocolType}" | grep -q 0; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 0 "${uuid}" "${email}")
|
clients=$(initXrayClients 0 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}${frontingType}.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}${frontingType}.json)
|
||||||
|
@ -5056,7 +5101,7 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# VLESS WS
|
# VLESS WS
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "1"; then
|
if echo "${currentInstallProtocolType}" | grep -q 1; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 1 "${uuid}" "${email}")
|
clients=$(initXrayClients 1 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}03_VLESS_WS_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}03_VLESS_WS_inbounds.json)
|
||||||
|
@ -5064,14 +5109,14 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trojan grpc
|
# trojan grpc
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "2"; then
|
if echo "${currentInstallProtocolType}" | grep -q 2; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 2 "${uuid}" "${email}")
|
clients=$(initXrayClients 2 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}04_trojan_gRPC_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}04_trojan_gRPC_inbounds.json)
|
||||||
echo "${clients}" | jq . >${configPath}04_trojan_gRPC_inbounds.json
|
echo "${clients}" | jq . >${configPath}04_trojan_gRPC_inbounds.json
|
||||||
fi
|
fi
|
||||||
# VMess WS
|
# VMess WS
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "3"; then
|
if echo "${currentInstallProtocolType}" | grep -q 3; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 3 "${uuid}" "${email}")
|
clients=$(initXrayClients 3 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}05_VMess_WS_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}05_VMess_WS_inbounds.json)
|
||||||
|
@ -5079,7 +5124,7 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trojan tcp
|
# trojan tcp
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "4"; then
|
if echo "${currentInstallProtocolType}" | grep -q 4; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 4 "${uuid}" "${email}")
|
clients=$(initXrayClients 4 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}04_trojan_TCP_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}04_trojan_TCP_inbounds.json)
|
||||||
|
@ -5087,7 +5132,7 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# vless grpc
|
# vless grpc
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "5"; then
|
if echo "${currentInstallProtocolType}" | grep -q 5; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 5 "${uuid}" "${email}")
|
clients=$(initXrayClients 5 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}06_VLESS_gRPC_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}06_VLESS_gRPC_inbounds.json)
|
||||||
|
@ -5095,7 +5140,7 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# vless reality vision
|
# vless reality vision
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "7"; then
|
if echo "${currentInstallProtocolType}" | grep -q 7; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 7 "${uuid}" "${email}")
|
clients=$(initXrayClients 7 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}07_VLESS_vision_reality_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}07_VLESS_vision_reality_inbounds.json)
|
||||||
|
@ -5103,27 +5148,30 @@ addUserXray() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# vless reality grpc
|
# vless reality grpc
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "8"; then
|
if echo "${currentInstallProtocolType}" | grep -q 8; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 8 "${uuid}" "${email}")
|
clients=$(initXrayClients 8 "${uuid}" "${email}")
|
||||||
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}08_VLESS_reality_fallback_grpc_inbounds.json)
|
clients=$(jq -r ".inbounds[0].settings.clients = ${clients}" ${configPath}08_VLESS_reality_fallback_grpc_inbounds.json)
|
||||||
echo "${clients}" | jq . >${configPath}08_VLESS_reality_fallback_grpc_inbounds.json
|
echo "${clients}" | jq . >${configPath}08_VLESS_reality_fallback_grpc_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# hysteria
|
# hysteria2
|
||||||
if echo "${currentInstallProtocolType}" | grep -q "6"; then
|
if echo ${currentInstallProtocolType} | grep -q 6; then
|
||||||
local clients=
|
local clients=
|
||||||
clients=$(initXrayClients 6 "${uuid}" "${email}")
|
clients=$(initXrayClients 6 "${uuid}" "${email}")
|
||||||
|
|
||||||
clients=$(jq -r ".auth.config = ${clients}" "${hysteriaConfigPath}config.json")
|
clients=$(jq -r ".inbounds[0].users = ${clients}" "${singBoxConfigPath}config/hysteria2.json")
|
||||||
echo "${clients}" | jq . >"${hysteriaConfigPath}config.json"
|
echo "${clients}" | jq . >"${singBoxConfigPath}config/hysteria2.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# tuic
|
||||||
if echo ${currentInstallProtocolType} | grep -q 9; then
|
if echo ${currentInstallProtocolType} | grep -q 9; then
|
||||||
local tuicResult
|
local clients=
|
||||||
|
clients=$(initXrayClients 9 "${uuid}" "${email}")
|
||||||
|
|
||||||
tuicResult=$(jq -r ".users.\"${uuid}\" += \"${uuid}\"" "${tuicConfigPath}config.json")
|
clients=$(jq -r ".inbounds[0].users = ${clients}" "${singBoxConfigPath}config/tuic.json")
|
||||||
echo "${tuicResult}" | jq . >"${tuicConfigPath}config.json"
|
|
||||||
|
echo "${hysteriaResult}" | jq . >"${singBoxConfigPath}config/tuic.json"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -5235,11 +5283,20 @@ addUser() {
|
||||||
trojanTCPResult=$(jq -r ".inbounds[0].settings.clients += [${trojanUsers}]" ${configPath}04_trojan_TCP_inbounds.json)
|
trojanTCPResult=$(jq -r ".inbounds[0].settings.clients += [${trojanUsers}]" ${configPath}04_trojan_TCP_inbounds.json)
|
||||||
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
# hysteria2
|
||||||
if echo ${currentInstallProtocolType} | grep -q 6; then
|
if echo ${currentInstallProtocolType} | grep -q 6; then
|
||||||
local hysteriaResult
|
local hysteriaResult
|
||||||
hysteriaResult=$(jq -r ".auth.config += [\"${uuid}\"]" "${hysteriaConfigPath}config.json")
|
users="{\"password\":\"${uuid}\",\"name\":\"${email}_singbox_hysteria2\"}"
|
||||||
echo "${hysteriaResult}" | jq . >"${hysteriaConfigPath}config.json"
|
hysteriaResult=$(jq -r ".inbounds[0].users += [${users}]" "${singBoxConfigPath}config/hysteria2.json")
|
||||||
|
echo "${hysteriaResult}" | jq . >"${hysteriaConfigPath}config/hysteria2.json"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# tuic
|
||||||
|
if echo ${currentInstallProtocolType} | grep -q 9; then
|
||||||
|
local hysteriaResult
|
||||||
|
users="{\"password\":\"${uuid}\",\"uuid\":\"${uuid}\",\"name\":\"${email}_singbox_tuic\"}"
|
||||||
|
hysteriaResult=$(jq -r ".inbounds[0].users += [\"${uuid}\"]" "${hysteriaConfigPath}config/tuic.json")
|
||||||
|
echo "${hysteriaResult}" | jq . >"${hysteriaConfigPath}config/tuic.json"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -5308,12 +5365,6 @@ removeUser() {
|
||||||
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
echo "${trojanTCPResult}" | jq . >${configPath}04_trojan_TCP_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q 6; then
|
|
||||||
local hysteriaResult
|
|
||||||
hysteriaResult=$(jq -r 'del(.auth.config['${delUserIndex}'])' "${hysteriaConfigPath}config.json")
|
|
||||||
echo "${hysteriaResult}" | jq . >"${hysteriaConfigPath}config.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if echo ${currentInstallProtocolType} | grep -q 7; then
|
if echo ${currentInstallProtocolType} | grep -q 7; then
|
||||||
local vlessRealityResult
|
local vlessRealityResult
|
||||||
vlessRealityResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}'])' ${configPath}07_VLESS_vision_reality_inbounds.json)
|
vlessRealityResult=$(jq -r 'del(.inbounds[0].settings.clients['${delUserIndex}'])' ${configPath}07_VLESS_vision_reality_inbounds.json)
|
||||||
|
@ -5325,10 +5376,15 @@ removeUser() {
|
||||||
echo "${vlessRealityGRPCResult}" | jq . >${configPath}08_VLESS_reality_fallback_grpc_inbounds.json
|
echo "${vlessRealityGRPCResult}" | jq . >${configPath}08_VLESS_reality_fallback_grpc_inbounds.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if echo ${currentInstallProtocolType} | grep -q 6; then
|
||||||
|
local hysteriaResult
|
||||||
|
hysteriaResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}config/hysteria2.json")
|
||||||
|
echo "${hysteriaResult}" | jq . >"${singBoxConfigPath}config/hysteria2.json"
|
||||||
|
fi
|
||||||
if echo ${currentInstallProtocolType} | grep -q 9; then
|
if echo ${currentInstallProtocolType} | grep -q 9; then
|
||||||
local tuicResult
|
local tuicResult
|
||||||
tuicResult=$(jq -r "del(.users.\"${uuid}\")" "${tuicConfigPath}config.json")
|
tuicResult=$(jq -r 'del(.inbounds[0].users['${delUserIndex}'])' "${singBoxConfigPath}config/tuic.json")
|
||||||
echo "${tuicResult}" | jq . >"${tuicConfigPath}config.json"
|
echo "${tuicResult}" | jq . >"${singBoxConfigPath}config/tuic.json"
|
||||||
fi
|
fi
|
||||||
reloadCore
|
reloadCore
|
||||||
fi
|
fi
|
||||||
|
@ -6503,10 +6559,7 @@ reloadCore() {
|
||||||
# handleTuic start
|
# handleTuic start
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
if [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'hysteria' </etc/v2ray-agent/sing-box/conf/config.json; then
|
if [[ -n "${singBoxConfigPath}" ]]; then
|
||||||
handleSingBox stop
|
|
||||||
handleSingBox start
|
|
||||||
elif [[ -n "${singBoxConfigPath}" ]] && [[ -f "/etc/v2ray-agent/sing-box/conf/config.json" ]] && grep -q 'tuic' </etc/v2ray-agent/sing-box/conf/config.json; then
|
|
||||||
handleSingBox stop
|
handleSingBox stop
|
||||||
handleSingBox start
|
handleSingBox start
|
||||||
fi
|
fi
|
||||||
|
@ -7991,8 +8044,6 @@ singBoxLog() {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
singBoxMergeConfig
|
|
||||||
|
|
||||||
handleSingBox stop
|
handleSingBox stop
|
||||||
handleSingBox start
|
handleSingBox start
|
||||||
}
|
}
|
||||||
|
@ -8042,10 +8093,10 @@ singBoxVersionManageMenu() {
|
||||||
local logStatus=
|
local logStatus=
|
||||||
if [[ -n "${singBoxConfigPath}" && "$(jq -r .log.disabled ${singBoxConfigPath}config.json)" == "true" ]]; then
|
if [[ -n "${singBoxConfigPath}" && "$(jq -r .log.disabled ${singBoxConfigPath}config.json)" == "true" ]]; then
|
||||||
echoContent yellow "5.关闭日志"
|
echoContent yellow "5.关闭日志"
|
||||||
logStatus=false
|
logStatus=true
|
||||||
else
|
else
|
||||||
echoContent yellow "5.启用日志"
|
echoContent yellow "5.启用日志"
|
||||||
logStatus=true
|
logStatus=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoContent yellow "6.查看日志"
|
echoContent yellow "6.查看日志"
|
||||||
|
@ -8102,7 +8153,7 @@ menu() {
|
||||||
cd "$HOME" || exit
|
cd "$HOME" || exit
|
||||||
echoContent red "\n=============================================================="
|
echoContent red "\n=============================================================="
|
||||||
echoContent green "作者:mack-a"
|
echoContent green "作者:mack-a"
|
||||||
echoContent green "当前版本:v2.11.2"
|
echoContent green "当前版本:v2.11.3"
|
||||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue