This commit is contained in:
parent
7bf4d40935
commit
cad482fd25
@ -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())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user