Added additional checks for status codes in keystatus

This commit is contained in:
ultimateplayer1999 2023-01-19 10:21:38 +01:00
parent 754585842a
commit 571a1bc3a7
Signed by: ultimateplayer1999
GPG Key ID: 690D4E43F8B51E51
2 changed files with 7 additions and 3 deletions

BIN
keystatus

Binary file not shown.

View File

@ -61,15 +61,19 @@ func main() {
}
// Print the response
if resp.StatusCode == http.StatusOK {
if resp.StatusCode == http.StatusOK {
fmt.Println("")
fmt.Println("Key status: Active")
fmt.Println("Key expire fulldate: ", r.KeyexpireString)
fmt.Println("Key expire date: ", r.ExpireDate)
fmt.Println("")
} else {
} else if resp.StatusCode == http.StatusUnauthorized {
fmt.Println("")
fmt.Println("Key status: Expired")
fmt.Println("")
} else {
fmt.Println("")
fmt.Println("Recieved a unlisted error.")
fmt.Println("")
}
}