Skip to content

Commit

Permalink
Version 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmacwhite committed Jun 16, 2016
1 parent 7953461 commit 35f9d8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions curl_url_test.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
#!/bin/bash
# curl_url_test.sh
# Author: James White (james.white@centralnottingham.ac.uk)
# Source: https://github.com/centralcollegenottingham/url-tester
# Version: 0.2
# Summary: Uses curl to test one or more URLs and the corresponding HTTP status code

# Description:
# A simple script that checks URLs and writes the response to a text file.
# Useful for checking batches of URLs quickly.
#

TIMESTAMP=$(date +%s)
URL_LIST_FILE="url_list.txt"
TEST_RESULT_FILE="curl_url_test_result.txt"
TEST_RESULT_FILE="curl_url_test_result-${TIMESTAMP}.txt"

if [ ! -f "${URL_LIST_FILE}" ] ; then
echo "URL list doesn't exist."
exit 1
fi

echo "Checking URL's list. Results will be recorded to ${TEST_RESULT_FILE}"
echo "Checking URLs list. Results will be recorded to ${TEST_RESULT_FILE}"
echo "Test started at: $(date)" >> ${TEST_RESULT_FILE}
# loop through file with URL list and record HTTP status code against tested URL
while read url ; do
Expand Down

0 comments on commit 35f9d8d

Please sign in to comment.