Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export http_proxy='http://proxy.test.cz:1234/'
- wget -nvq --proxy-user=test --proxy-password=test google.com &>/dev/null | grep -q 'You cant user internet' || echo "Proxy isnt working. " | mail -s "Proxy isnt working" -r "No-reply<no-reply@soma.cz>" test@mail.cz
- wget -nvq --proxy-user=test --proxy-password=test google.com &>/dev/null | grep -q 'You cant user internet' || (echo "Proxy isnt working. " | mail -s "Proxy isnt working" -r "No-reply<no-reply@soma.cz>" test@mail.cz)
- #!/bin/bash
- OUTPUT_FILE=/tmp/$$.txt
- wget -nvq --proxy-user=test --proxy-password=test google.com > ${OUTPUT_FILE} 2>&1
- grep -q 'You cant user internet' ${OUTPUT_FILE}
- if [ "$?" -eq "0" ]
- then
- echo "Proxy isnt working. " | mail -s "Proxy isnt working" -r "No-reply<no-reply@soma.cz>" test@mail.cz
- else
- echo "Proxy is working"
- fi
Add Comment
Please, Sign In to add comment