diff options
-rwxr-xr-x | pull-images | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pull-images b/pull-images index fd864bc..944228a 100755 --- a/pull-images +++ b/pull-images @@ -5,10 +5,13 @@ usage="Usage: $0 filename [urlroot]" test $# -eq 0 && echo "$usage" && exit 1 test $# -gt 2 && echo "$usage" && exit 1 +proto=`echo "$2" | awk -F : '{print $1}'` + imgurls=`cat "$1" \ | awk -F \( '/!\[[^\]]*\]\([^\)]*\)/ {print $2}' \ | sed 's/).*//' \ | awk '{print $1}' \ +| sed "s/^\/\//${proto}:\/\//g" \ | sort | uniq` for i in $imgurls; do |