cleanUpOpenSSHVersion cleans up the raw output of "ssh -V" and returns a clean version string.
(raw string)
| 12 | |
| 13 | // cleanUpOpenSSHVersion cleans up the raw output of "ssh -V" and returns a clean version string. |
| 14 | func cleanUpOpenSSHVersion(raw string) string { |
| 15 | v := strings.TrimRight(strings.Fields(raw)[0], ",1234567890") |
| 16 | v = strings.TrimSuffix(strings.TrimPrefix(v, "OpenSSH_"), "p") |
| 17 | return v |
| 18 | } |
| 19 | |
| 20 | // openSSHVersion returns string representation of OpenSSH version via command "ssh -V". |
| 21 | func openSSHVersion() (string, error) { |
no outgoing calls