Skip to content

Instantly share code, notes, and snippets.

@Alexhha
Created October 26, 2017 12:12
Show Gist options
  • Save Alexhha/5b2bdb46d6ca655806478864c6fb6ea1 to your computer and use it in GitHub Desktop.
Save Alexhha/5b2bdb46d6ca655806478864c6fb6ea1 to your computer and use it in GitHub Desktop.
#!/bin/bash
http_code=0
function result_handling {
case "${http_code}" in
"401" | "403" | "404" )
echo "Error: httpd code ${http_code}"
;;
"200" | "301" )
echo "Ok: httpd code ${http_code}"
;;
esac
}
function upload_data {
http_code=301
result_handling
}
upload_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment