🎨
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
coward 2024-05-09 14:19:33 +08:00
parent 7bf4d40935
commit cad482fd25

View File

@ -47,7 +47,7 @@ func RestartWireguard(isAsync bool) {
func StopWireguard() { func StopWireguard() {
configFileName := getConfigFileName() configFileName := getConfigFileName()
if err := exec.Command(fmt.Sprintf("wg-quick down %s", configFileName)).Run(); err != nil { if err := exec.Command("/bin/sh", "-c", fmt.Sprintf("wg-quick down %s", configFileName)).Run(); err != nil {
log.Errorf("停止wireguard服务端失败: %v", err.Error()) log.Errorf("停止wireguard服务端失败: %v", err.Error())
} }
@ -59,7 +59,7 @@ func StopWireguard() {
func StartWireguard() { func StartWireguard() {
configFileName := getConfigFileName() configFileName := getConfigFileName()
if err := exec.Command(fmt.Sprintf("wg-quick up %s", configFileName)).Run(); err != nil { if err := exec.Command("/bin/sh", "-c", fmt.Sprintf("wg-quick up %s", configFileName)).Run(); err != nil {
log.Errorf("启动wireguard服务端失败: %v", err.Error()) log.Errorf("启动wireguard服务端失败: %v", err.Error())
} }