niujiuru hace 1 día
padre
commit
0405bf04d7
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      web-ui.service/web_handler.go

+ 9 - 0
web-ui.service/web_handler.go

@@ -470,6 +470,15 @@ func serviceControlHandler(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
+	if req.Action == "stop" && req.Name == "yfkj-frp-client.service" {
+		go func() {
+			_ = systemctl(req.Action, req.Name)
+		}()
+
+		json.NewEncoder(w).Encode(map[string]bool{"ok": true})
+		return
+	}
+
 	if err := systemctl(req.Action, req.Name); err != nil {
 		http.Error(w, err.Error(), http.StatusInternalServerError)
 		return