From a96eb89a7ad166a7c87dc9ea9dbbe044d3064d5d Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Fri, 13 Feb 2015 10:19:42 +0100 Subject: More info during data collection. --- runcheck | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/runcheck b/runcheck index f368b67..2763703 100755 --- a/runcheck +++ b/runcheck @@ -2,7 +2,7 @@ set -e -file=testurls.txt +file=urls-test.txt if [ "$1" ] ; then file="$1" @@ -14,16 +14,19 @@ cat $file | while read url ; do # Save with URL as filename, replacing / with % and dropping trailing slash. filename=$(echo "$url" | sed 's%/$%%' |tr / %) 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" + if [ ! -e "$harfile" ] ; then + echo "testing $url" + if phantomjs netsniff.js "$url" > "$harfile.new" && + [ -s "$harfile.new" ]; then + mv "$harfile.new" "$harfile" + else + rm "$harfile.new" + fi else - rm "$harfile.new" + echo found $harfile, not downloading + fi + if [ -e "$harfile" ] && grep -q google-analytics.com "$harfile" ; then + echo "NSA/FRA warning for $url" fi ;; esac -- cgit v1.2.3