Guest User

Untitled

a guest
May 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. hosts=(HOSTNAME-vip{1..4})
  4.  
  5. for a in ${hosts[@]}
  6. do
  7. echo "=== $a ==="
  8. f=$(mktemp)
  9. openssl s_client -connect $a:443 2>$f </dev/null |\
  10. sed -n '/^-*BEGIN/,/^-*END/p' |\
  11. openssl x509 -noout -text |\
  12. sed -n 's/^ //;
  13. /Issuer:/,/Subject:/p;
  14. /Subject Alternative Name:/,+1p'
  15. echo
  16. unlink $f
  17. done
Add Comment
Please, Sign In to add comment