mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-10 00:00:26 +08:00
优化可执行文件程序
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
executils "github.com/TeaOSLab/EdgeAdmin/internal/utils/exec"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"os/exec"
|
||||
@@ -14,7 +15,7 @@ func AddPortsToFirewall(ports []int) {
|
||||
// Linux
|
||||
if runtime.GOOS == "linux" {
|
||||
// firewalld
|
||||
firewallCmd, _ := exec.LookPath("firewall-cmd")
|
||||
firewallCmd, _ := executils.LookPath("firewall-cmd")
|
||||
if len(firewallCmd) > 0 {
|
||||
err := exec.Command(firewallCmd, "--add-port="+types.String(port)+"/tcp").Run()
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user