Shell 脚本:循环下载文件并自动删除
#!/bin/bash
url='http://cachefly.cachefly.net/100mb.test' filename='100mb.test'
while true; do wget -c $url -O $filename if [ $? -eq 0 ]; then echo 'Download completed.' rm $filename break else echo 'Download failed. Retrying in 5 seconds...' sleep 5 fi done
exit 0
原文地址: https://www.cveoy.top/t/topic/mIZ2 著作权归作者所有。请勿转载和采集!