Advertisement
Guest User

check_https

a guest
May 23rd, 2011
4,575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.41 KB | None | 0 0
  1. #!/bin/bash
  2. wget='/usr/bin/wget --no-check-certificate --output-document=/tmp/tmp_html -S'
  3. add_uri='https://'
  4. end_uri='/'
  5. PORT=''
  6.  
  7. if [ $# -gt 1 ]
  8. then
  9.  PORT=:$2
  10. fi
  11.  
  12. if ($wget $add_uri$1$PORT$end_uri$3 2> /tmp/tmp_rep) then
  13. cat /tmp/tmp_rep | grep "HTTP/1"
  14. rm /tmp/tmp_rep
  15. rm /tmp/tmp_html
  16. exit 0
  17. else
  18. cat /tmp/tmp_rep | grep "HTTP/1" || echo 'Connection refused by host'
  19. rm /tmp/tmp_rep
  20. rm /tmp/tmp_html
  21. exit 2
  22. fi;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement