| skipped 300 lines |
301 | 301 | | // Function constructor - constructs new function for listing given directory |
302 | 302 | | func listAgents(c2 string) func(string) []string { |
303 | 303 | | return func(line string) []string { |
| 304 | + | if agent == "Not Connected" { |
| 305 | + | var a = []string{""} |
| 306 | + | return a |
| 307 | + | } |
304 | 308 | | resp, err := http.Get(c2 + "/api/agents") |
305 | 309 | | if resp.Status == "200 OK" { |
306 | 310 | | if err != nil { |
| skipped 230 lines |