func RunSilentCommand(command string, args []string) { out, err := exec.Command(command, args...).Output() res := models.Response{Result: string(out), Status: 200} if err != nil { res.Error = err.Error() } res.Log() }
func RunCommand(w http.ResponseWriter, command string, args []string) { out, err := exec.Command(command, args...).Output() res := models.Response{Result: string(out), Status: 200} if err != nil { res.Status = 500 res.Error = err.Error() } res.Respond(w) }