mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-29 07:56:37 +08:00
增加协议屏蔽支持
This commit is contained in:
+13
-13
@@ -115,21 +115,21 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
go func() {
|
||||
// if runtime.GOOS == "linux" {
|
||||
// go func() {
|
||||
|
||||
ruleFile := "./rules.yaml"
|
||||
if _, err := os.Stat(ruleFile); os.IsNotExist(err) {
|
||||
if err := os.WriteFile(ruleFile, []byte(""), 0644); err != nil {
|
||||
log.Printf("failed to create rules file: %v", err)
|
||||
} else {
|
||||
log.Printf("created empty rules file: %s", ruleFile)
|
||||
}
|
||||
}
|
||||
// ruleFile := "./rules.yaml"
|
||||
// if _, err := os.Stat(ruleFile); os.IsNotExist(err) {
|
||||
// if err := os.WriteFile(ruleFile, []byte(""), 0644); err != nil {
|
||||
// log.Printf("failed to create rules file: %v", err)
|
||||
// } else {
|
||||
// log.Printf("created empty rules file: %s", ruleFile)
|
||||
// }
|
||||
// }
|
||||
|
||||
cmd.Execute([]string{ruleFile})
|
||||
}()
|
||||
}
|
||||
// cmd.Execute([]string{ruleFile})
|
||||
// }()
|
||||
// }
|
||||
|
||||
fmt.Println("✅ 配置加载成功 - addr: %s", config.Addr)
|
||||
|
||||
|
||||
+6
-6
@@ -12,7 +12,7 @@ show_menu() {
|
||||
echo "1. 安装"
|
||||
echo "2. 更新"
|
||||
echo "3. 卸载"
|
||||
echo "4. 屏蔽协议"
|
||||
# echo "4. 屏蔽协议"
|
||||
echo "5. 退出"
|
||||
echo "==============================================="
|
||||
}
|
||||
@@ -201,11 +201,11 @@ block_protocol() {
|
||||
|
||||
echo "✅ GOST 服务检测通过"
|
||||
|
||||
# 检查并安装 iptables
|
||||
# if ! check_and_install_iptables; then
|
||||
# echo "❌ iptables 检查失败,无法继续"
|
||||
# return 1
|
||||
# fi
|
||||
检查并安装 iptables
|
||||
if ! check_and_install_iptables; then
|
||||
echo "❌ iptables 检查失败,无法继续"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 验证 IPv4
|
||||
is_ipv4() {
|
||||
|
||||
@@ -89,7 +89,6 @@ public class CheckGostConfigAsync {
|
||||
}
|
||||
}, "清理服务 " + service.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +117,7 @@ public class CheckGostConfigAsync {
|
||||
}
|
||||
List<Long> diff = new ArrayList<>(speedLimits_ids);
|
||||
diff.removeAll(limiters_ids);
|
||||
System.out.println(diff);
|
||||
if (!diff.isEmpty()) {
|
||||
|
||||
for (Long speed_id : diff) {
|
||||
@@ -164,6 +164,7 @@ public class CheckGostConfigAsync {
|
||||
}
|
||||
List<Long> diff = new ArrayList<>(forward_ids);
|
||||
diff.removeAll(services_ids);
|
||||
System.out.println(diff);
|
||||
if (!diff.isEmpty()) {
|
||||
for (Long forward_id : diff) {
|
||||
Forward forward = forwardService.getById(forward_id);
|
||||
|
||||
Reference in New Issue
Block a user