| @@ 157-177 (lines=21) @@ | ||
| 154 | ); |
|
| 155 | } |
|
| 156 | ||
| 157 | private function execEasyRsa(array $argv) |
|
| 158 | { |
|
| 159 | $command = sprintf( |
|
| 160 | '%s/easyrsa --vars=%s/vars %s >/dev/null 2>/dev/null', |
|
| 161 | $this->easyRsaDir, |
|
| 162 | $this->easyRsaDataDir, |
|
| 163 | implode(' ', $argv) |
|
| 164 | ); |
|
| 165 | ||
| 166 | exec( |
|
| 167 | $command, |
|
| 168 | $commandOutput, |
|
| 169 | $returnValue |
|
| 170 | ); |
|
| 171 | ||
| 172 | if (0 !== $returnValue) { |
|
| 173 | throw new RuntimeException( |
|
| 174 | sprintf('command "%s" did not complete successfully: "%s"', $command, $commandOutput) |
|
| 175 | ); |
|
| 176 | } |
|
| 177 | } |
|
| 178 | } |
|
| 179 | ||
| @@ 42-60 (lines=19) @@ | ||
| 39 | return FileIO::readFile($taFile); |
|
| 40 | } |
|
| 41 | ||
| 42 | private function execOpenVpn(array $argv) |
|
| 43 | { |
|
| 44 | $command = sprintf( |
|
| 45 | '/usr/sbin/openvpn %s >/dev/null 2>/dev/null', |
|
| 46 | implode(' ', $argv) |
|
| 47 | ); |
|
| 48 | ||
| 49 | exec( |
|
| 50 | $command, |
|
| 51 | $commandOutput, |
|
| 52 | $returnValue |
|
| 53 | ); |
|
| 54 | ||
| 55 | if (0 !== $returnValue) { |
|
| 56 | throw new RuntimeException( |
|
| 57 | sprintf('command "%s" did not complete successfully: "%s"', $command, $commandOutput) |
|
| 58 | ); |
|
| 59 | } |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||