Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- curr=$(pwd)
- IP_addr="192.168.0.102"
- username="root"
- password="pass"
- HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP)
- echo
- echo "echo the variable works!"
- echo $HTTP_STATUS
- isOK=$(echo $HTTP_STATUS)
- status="HTTP/1.1 401 Unauthorized"
- echo
- if [[ $HTTP_STATUS == $status ]]; then
- echo "The same the same!"
- else
- echo "$isOK is not the same as $status"
- fi
- echo
- if [ "$status" == "$isOK" ]
- then
- echo "The same the same!"
- else
- echo "$isOK is not the same as $status"
- fi
- HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP | tee $curr/test.txt)
- HTTP_STATUS=$(curl -IL --silent $username:$password@$IP_addr | grep HTTP)
- ./test.sh
- echo the variable works!
- HTTP/1.1 401 Unauthorized
- is not the same as HTTP/1.1 401 Unauthorized
- is not the same as HTTP/1.1 401 Unauthorized
- HTTP_STATUS=`curl -IL --silent $username:$password@$IP_addr | grep HTTP`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement