(DockerClient client, String proto)
| 141 | } |
| 142 | |
| 143 | public void startContainer(DockerClient client, String proto) { |
| 144 | InspectContainerResponse inspect = client.inspectContainerCmd(containerName).exec(); |
| 145 | if (inspect.getState().getRunning()) { |
| 146 | |
| 147 | // running |
| 148 | log("OpenVPN Server is already running"); |
| 149 | return; |
| 150 | } |
| 151 | |
| 152 | try { |
| 153 | |
| 154 | // start the server |
| 155 | client.startContainerCmd(containerName).exec(); |
| 156 | } catch (NotFoundException e) { |
| 157 | |
| 158 | err(e.toString()); |
| 159 | } catch (NotModifiedException e) { |
| 160 | |
| 161 | log(e.toString()); |
| 162 | } catch (Exception e) { |
| 163 | |
| 164 | errWithStackTrace(e); |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | public void removeContainer(DockerClient client) { |
| 169 | RemoveContainerCmd remove = client.removeContainerCmd(containerName).withForce(true); |
no test coverage detected