Skip to content

Commit

Permalink
fix(脚本): 修改socks5 rule_set分流错误问题、修改卸载无法停止入站问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Jan 19, 2024
1 parent 29a48c5 commit f7edfe1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6571,6 +6571,7 @@ socks5Routing() {
}
# Socks5入站菜单
socks5InboundRoutingMenu() {
readInstallType
echoContent skyBlue "\n功能 1/1 : Socks5入站"
echoContent red "\n=============================================================="

Expand Down Expand Up @@ -6726,17 +6727,19 @@ removeSocks5Routing() {

removeSingBoxConfig socks5_outbound_route
removeSingBoxConfig socks5_inbound_route

elif [[ "${unInstallSocks5RoutingStatus}" == "2" ]]; then

removeSingBoxConfig 20_socks5_inbounds
removeSingBoxConfig socks5_inbound_route

handleSingBox stop
elif [[ "${unInstallSocks5RoutingStatus}" == "3" ]]; then
removeSingBoxConfig 20_socks5_inbounds
removeSingBoxConfig socks5_inbound_route

unInstallOutbounds socks5_outbound
unInstallRouting socks5_outbound outboundTag
handleSingBox stop
else
echoContent red " ---> 选择错误"
exit 0
Expand Down Expand Up @@ -6797,17 +6800,19 @@ initSingBoxRules() {
geositeStatus=$(curl -s "https://api.github.com/repos/SagerNet/sing-geosite/contents/geosite-${line}.srs?ref=rule-set" | jq .message)

if [[ "${geositeStatus}" == "null" ]]; then
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${line}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${line}.srs\"}]")
ruleSet=$(echo "${ruleSet}" | jq -r ". += [{\"tag\":\"${line}_$2\",\"type\":\"remote\",\"format\":\"binary\",\"url\":\"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-${line}.srs\",\"download_detour\":\"direct\"}]")
else
domainRules=$(echo "${domainRules}" | jq -r ". += [\"${line}\"]")

fi
done < <(echo "$1" | tr ',' '\n')
echo "{ \"domainRules\":${domainRules},\"ruleSet\":${ruleSet}}"
}

# socks5 inbound routing规则
setSocks5InboundRouting() {

singBoxConfigPath=/etc/v2ray-agent/sing-box/conf/config/

if [[ "$1" == "addRules" && ! -f "${singBoxConfigPath}socks5_inbound_route.json" && ! -f "${configPath}09_routing.json" ]]; then
echoContent red " ---> 请安装入站分流后再添加分流规则"
echoContent red " ---> 如已选择允许所有网站,请重新安装分流后设置规则"
Expand Down Expand Up @@ -8904,7 +8909,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者:mack-a"
echoContent green "当前版本:v3.1.36"
echoContent green "当前版本:v3.1.37"
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit f7edfe1

Please sign in to comment.