diff --git a/.gitignore b/.gitignore index 56e15dc..498e164 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ # vendor/ .idea logs +web # Go workspace file go.work diff --git a/command/wireguard.go b/command/wireguard.go index ee8763b..fb063e9 100644 --- a/command/wireguard.go +++ b/command/wireguard.go @@ -3,7 +3,6 @@ package command import ( "fmt" "gitee.ltd/lxh/logger/log" - "os" "os/exec" "strings" "wireguard-dashboard/repository" @@ -49,11 +48,7 @@ func StopWireguard() { configFileName := getConfigFileName() cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("wg-quick down %s", configFileName)) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - if err := cmd.Run(); err != nil { - log.Errorf("停止wireguard[%s]服务端失败: %v", configFileName, err.Error()) - } else { + if err := cmd.Run(); err == nil { log.Infof("停止wireguard[%s]服务端成功", configFileName) } @@ -66,11 +61,7 @@ func StartWireguard() { configFileName := getConfigFileName() cmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("wg-quick up %s", configFileName)) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - if err := cmd.Run(); err != nil { - log.Errorf("启动wireguard[%s]服务端失败: %v", configFileName, err.Error()) - } else { + if err := cmd.Run(); err == nil { log.Infof("启动wireguard[%s]服务端成功", configFileName) } return diff --git a/web/static.go b/web/static.go deleted file mode 100644 index 7de0a58..0000000 --- a/web/static.go +++ /dev/null @@ -1,6 +0,0 @@ -package web - -import "embed" - -//go:embed index.html logo.svg favicon.ico platform-config.json static assets -var Static embed.FS