#!/bin/bash # # Arguments # MODEL # function getFileNoCheck() { wget -O ${1} ${2} sleep $(($RANDOM % 5)) } function getFileCheck() { if [ ! -e $1 ]; then wget -O ${1} ${2} sleep $(($RANDOM % 5)) fi } model=${1} downloadRoot="automatic/${model}" operationBaseName="${downloadRoot}/model" mkdir -p ${downloadRoot} for i in `seq 300`; do if [ ! -e "${operationBaseName}_$i.xml" ] ; then getFileCheck "${operationBaseName}_$i.xml" "http:///index.html?_dc=$(date +%s)" fi done #Done