()
| 80 | } |
| 81 | |
| 82 | func getShell() (string, error) { |
| 83 | // try to get a shell |
| 84 | _, err := exec.LookPath("bash") |
| 85 | if err != nil { |
| 86 | _, err := exec.LookPath("sh") |
| 87 | if err != nil { |
| 88 | return "", fmt.Errorf("neither 'bash' nor 'sh' found in container. Please make sure at least one is available in the container $PATH") |
| 89 | } |
| 90 | |
| 91 | return "sh", nil |
| 92 | } |
| 93 | |
| 94 | return "bash", nil |
| 95 | } |
| 96 | |
| 97 | func (s *Server) handler(sess ssh.Session) { |
| 98 | cmd := s.getCommand(sess) |