Skip to content

Commit

Permalink
Add detailed error messaging to status
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Mar 3, 2022
1 parent 924e6b3 commit 0d583f0
Showing 1 changed file with 53 additions and 14 deletions.
67 changes: 53 additions & 14 deletions easytls
Original file line number Diff line number Diff line change
Expand Up @@ -2120,38 +2120,77 @@ status ()
if [ -n "${subsection}" ]; then
case "${subsection}" in
val|valid)
status_easyrsa_valid || return 1
status_easyrsa_valid || {
error_msg "status - status_easyrsa_valid"
return 1
}
;;
rev|revoked)
status_easyrsa_revoked || return 1
status_easyrsa_revoked || {
error_msg "status - status_easyrsa_revoked"
return 1
}
;;
inl|inline)
status_easytls_inline || return 1
status_easytls_inline || {
error_msg "status - status_easytls_inline"
return 1
}
;;
inv|invalid)
silent_status=1
status_easyrsa_valid || return 1
status_easyrsa_revoked || return 1
status_easytls_inline || return 1
status_easyrsa_valid || {
error_msg "status - invalid - status_easyrsa_valid"
return 1
}
status_easyrsa_revoked || {
error_msg "status - invalid - status_easyrsa_revoked"
return 1
}
status_easytls_inline || {
error_msg "status - invalid - status_easytls_inline"
return 1
}
unset -v silent_status
status_easytls_invalid || return 1
status_easytls_invalid || {
error_msg "status - invalid - status_easytls_invalid"
return 1
}
;;
ren|renewed)
silent_status=1
status_easyrsa_valid || return 1
status_easyrsa_revoked || return 1
status_easytls_inline || return 1
status_easyrsa_valid || {
error_msg "status - renewed - status_easyrsa_valid"
return 1
}
status_easyrsa_revoked || {
error_msg "status - renewed - status_easyrsa_revoked"
return 1
}
status_easytls_inline || {
error_msg "status - renewed - status_easytls_inline"
return 1
}
unset -v silent_status
status_easyrsa_renewed || return 1
status_easyrsa_renewed || {
error_msg "status - renewed - status_easyrsa_renewed"
return 1
}
;;
dis|disabled)
status_disabled_list || return 1
status_disabled_list || {
error_msg "status - status_disabled_list"
return 1
}
;;
tls|tlskeys)
status_easytls_tlskeys || return 1
status_easytls_tlskeys || {
error_msg "status - status_easytls_tlskeys"
return 1
}
;;
*)
print "Unknown status option"
error_msg "Unknown status option"
return 1
;;
esac
Expand Down

0 comments on commit 0d583f0

Please sign in to comment.