install: add support for native ssl command

The code should auto-select the native ssl method if the ssl command is available on the UPS.

If this fails, install will drop back to the original install method used by this tool (which works on NMC2).
This commit is contained in:
Greg T. Wallace 2024-06-06 22:51:12 -04:00
parent 06c9263bc4
commit dda11df624
5 changed files with 77 additions and 14 deletions
pkg/apcssh

View file

@ -79,7 +79,10 @@ func (cli *Client) cmd(command string) (*upsCmdResponse, error) {
codeTxtIndx := strings.Index(result, "\n")
res.codeText = result[:codeTxtIndx-1]
res.resultText = result[codeTxtIndx+1 : len(result)-2]
// avoid out of bounds if no result text
if codeTxtIndx+1 <= len(result)-2 {
res.resultText = result[codeTxtIndx+1 : len(result)-2]
}
break
}
}