aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2015-02-13 09:11:24 +0100
committerPetter Reinholdtsen <pere@hungry.com>2015-02-13 09:11:24 +0100
commit67496ee0e926089ef8a2dd937f8dfcfa9e86cdaa (patch)
tree8b3de935e5c69033f2e3189bf0aad6916f4aeab8
parent0b778614ee45ef37a0d2ce7998f5e9b412debd04 (diff)
Make less noisy and more robust.
-rwxr-xr-xruncheck14
1 files changed, 10 insertions, 4 deletions
diff --git a/runcheck b/runcheck
index 1abe33a..f368b67 100755
--- a/runcheck
+++ b/runcheck
@@ -13,11 +13,17 @@ cat $file | while read url ; do
http*)
# Save with URL as filename, replacing / with % and dropping trailing slash.
filename=$(echo "$url" | sed 's%/$%%' |tr / %)
- echo "$url"
- if phantomjs netsniff.js "$url" > "har-data/$filename.har.new" ; then
- mv "har-data/$filename.har.new" "har-data/$filename.har"
+ harfile="har-data/$filename.har"
+ if [ -e "$harfile" ] ; then
+ echo found $harfile, skipping
+ continue
+ fi
+ echo "testing $url"
+ if phantomjs netsniff.js "$url" > "$harfile.new" &&
+ [ -s "$harfile.new" ]; then
+ mv "$harfile.new" "$harfile"
else
- rm "har-data/$filename.har.new"
+ rm "$harfile.new"
fi
;;
esac