mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-01-22 08:14:08 +00:00
ssh: switch string comps to EqualFold func
This commit is contained in:
parent
c669621bd3
commit
7bf70c4d71
2 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ func (cli *Client) RestartWebUI() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if strings.ToLower(result.code) != "e000" {
|
||||
if !strings.EqualFold(result.code, "e000") {
|
||||
return fmt.Errorf("apcssh: failed to restart web ui (%s: %s)", result.code, result.codeText)
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ func (cli *Client) InstallSSLCert(keyP15 []byte, certPem []byte, keyCertP15 []by
|
|||
return fmt.Errorf("apcssh: ssl cert install: failed to send ssl cmd (%w)", err)
|
||||
}
|
||||
// E101 is the code for "Command Not Found"
|
||||
supportsSSLCmd := strings.ToLower(result.code) != "e101"
|
||||
supportsSSLCmd := !strings.EqualFold(result.code, "e101")
|
||||
|
||||
// if SSL is supported, use that method
|
||||
if supportsSSLCmd {
|
||||
|
@ -46,7 +46,7 @@ func (cli *Client) installSSLCertModern(keyP15 []byte, certPem []byte) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("apcssh: ssl cert install: failed to send ssl key install cmd (%w)", err)
|
||||
}
|
||||
if strings.ToLower(result.code) != "e000" {
|
||||
if !strings.EqualFold(result.code, "e000") {
|
||||
return fmt.Errorf("apcssh: ssl cert install: ssl key install cmd returned error code (%s: %s)", result.code, result.codeText)
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ func (cli *Client) installSSLCertModern(keyP15 []byte, certPem []byte) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("apcssh: ssl cert install: failed to send ssl cert install cmd (%w)", err)
|
||||
}
|
||||
if strings.ToLower(result.code) != "e000" {
|
||||
if !strings.EqualFold(result.code, "e000") {
|
||||
return fmt.Errorf("apcssh: ssl cert install: ssl cert install cmd returned error code (%s: %s)", result.code, result.codeText)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue