#!/bin/SH for((i=0; i< -; i=i+1)); Do# Use the spider to detect if the requested resource exists and write the result of the request to a filewget--spider--http-user=username--http-password=passwd--no-check-certificate-e"Https_proxy=http://url:port"FileURL &>SpiderResult.txt # Read the contents of the file into a variable ABC="' Cat/home/yxf/spiderresult.txt '"# Read the last 6 characters of the variable, and if it is exists the file to be downloaded is present, in which case a file download request can be initiated Okindex=${ABC: (-7):6} if["$okIndex"="exists"]; Then# File Downloadwget-p/download/billdownload--http-user=username--http-password=passwd--no-check-certificate-e"Https_proxy=http://url:port"FileURL Breakfi# If the file does not exist, put the current thread to sleep for 20 minutesSleep20m Done
Wrote a simple Linux shell to download files