diff --git a/imagesync.sh b/imagesync.sh index 468fce0..4a893aa 100755 --- a/imagesync.sh +++ b/imagesync.sh @@ -178,7 +178,15 @@ echo ' # --summary-interval=0: do not show summary while downloading # --console-log-level=error: Only show errors # --dht-file-path=dht.dat: use generated dht data file and do not complain -aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --console-log-level=error --dht-file-path=dht.dat $torrent +download=true +while [ $download == true ];do + aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --console-log-level=error --dht-file-path=dht.dat $torrent + if [ $? == 0 ];then + download=false + else + rm rootfs.tar.gz rootfs.torrent + fi +done rm dht.dat print_done