Created
March 5, 2017 19:13
-
-
Save ceme/58ba3c33354470cb762edec939132119 to your computer and use it in GitHub Desktop.
Chatty curl to output file with cheap argument host validation, no usefull usage instructions, and hardcoded output file name, pretty rudimentery code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
function check { | |
if [ $? -ne 0 ] ; then | |
echo "Error occurred getting URL $1;" | |
if [ $? -eq 6 ]; then | |
echo "Unable to reslove host" | |
fi | |
if [ $? -eq 7 ]; then | |
echo "Unable to contact host" | |
fi | |
exit 1 | |
fi | |
} | |
curl -s -o "check_out001.txt" $1 | |
check; | |
echo 'got it' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment