beautify aria2c (only show download progess)
This commit is contained in:
parent
4663551e24
commit
f1753c606d
1 changed files with 9 additions and 12 deletions
21
imagesync.sh
21
imagesync.sh
|
|
@ -10,7 +10,6 @@ prereqs)
|
|||
copy_exec /sbin/sfdisk
|
||||
copy_exec /sbin/mke2fs
|
||||
copy_exec /sbin/e2fsck
|
||||
copy_exec /usr/bin/xxd
|
||||
copy_file cert /etc/ssl/certs/ca-certificates.crt
|
||||
exit 0
|
||||
;;
|
||||
|
|
@ -165,30 +164,28 @@ print_done
|
|||
##
|
||||
|
||||
print_waiting "Downloading root filesystem image"
|
||||
# do not complain about missing dht database
|
||||
echo '
|
||||
00000000: a1a2 0200 0000 0003 0000 0000 5a81 9b23 ............Z..#
|
||||
00000010: 0000 0000 0000 0000 0c26 e387 dc94 df37 .........&.....7
|
||||
00000020: 41be 919e 5166 4676 60e0 7435 0000 0000 A...QfFv`.t5....
|
||||
00000030: 0000 0000 0000 0000 ........
|
||||
'|xxd -r > dht.dat
|
||||
|
||||
# --allow-overwrite: do not rename the torrent file
|
||||
# --check-integrity: verify downloaded file and do not complain about missing controll file
|
||||
# --seed-time=0: do not wait until ratio 1, we seed when we’re booted
|
||||
# --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
|
||||
# --download-result=hide: Do not show download results
|
||||
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
|
||||
aria2c \
|
||||
--allow-overwrite \
|
||||
--check-integrity \
|
||||
--seed-time=0 \
|
||||
--summary-interval=0 \
|
||||
--console-log-level=error \
|
||||
--download-result=hide \
|
||||
$torrent 2>&1 | grep -v 'DHT routing table'
|
||||
if [ $? == 0 ];then
|
||||
download=false
|
||||
else
|
||||
rm rootfs.tar.gz rootfs.torrent
|
||||
fi
|
||||
done
|
||||
rm dht.dat
|
||||
print_done
|
||||
|
||||
print_waiting "Comparing installed and remote image"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue