You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
341 B

  1. #!/bin/sh
  2. cmd="$(command -v curl)"
  3. url="http://example.com/"
  4. success_string="Thank you!"
  5. if [ ! -x "${cmd}" ]
  6. then
  7. exit 1
  8. fi
  9. response="$("${cmd}" $url -d "password=$2&pwd=$2&username=$1" \
  10. --header "Content-Type:application/x-www-form-urlencoded" -s)"
  11. if echo "${response}" | grep -q "${success_string}";
  12. then
  13. exit 0
  14. else
  15. exit 2
  16. fi