Advertisement
Guest User

Untitled

a guest
Dec 17th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. curr=$(pwd)
  4. IP_addr="192.168.0.102"
  5. username="root"
  6. password="pass"
  7.  
  8. HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP)
  9. echo
  10. echo "echo the variable works!"
  11. echo $HTTP_STATUS
  12. isOK=$(echo $HTTP_STATUS)
  13. status="HTTP/1.1 401 Unauthorized"
  14.  
  15. echo
  16.  
  17. if [[ $HTTP_STATUS == $status ]]; then
  18. echo "The same the same!"
  19. else
  20. echo "$isOK is not the same as $status"
  21. fi
  22.  
  23. echo
  24.  
  25. if [ "$status" == "$isOK" ]
  26. then
  27. echo "The same the same!"
  28. else
  29. echo "$isOK is not the same as $status"
  30. fi
  31.  
  32. HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP | tee $curr/test.txt)
  33.  
  34. HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP)
  35.  
  36. ./test.sh
  37. echo the variable works!
  38. HTTP/1.1 401 Unauthorized
  39.  
  40. is not the same as HTTP/1.1 401 Unauthorized
  41.  
  42. is not the same as HTTP/1.1 401 Unauthorized
  43.  
  44. HTTP_STATUS=`curl -IL --silent $username:$password@$IP_addr | grep HTTP`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement