Fix aria2c blocking when reading information

This commit is contained in:
Simon Bruder 2018-03-11 16:28:32 +00:00
parent 9ff5d1e62a
commit 1a44be289f
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -66,7 +66,7 @@ labsync_premount() {
labsync_mount_root() {
labsync_info "Downloading torrent file from ${labsync_torrent}"
while ! wget -T 10 -O /tmp/torrent "${labsync_torrent}"; do sleep 1; done
aria2c -S -T /tmp/torrent > /tmp/torrent_info
aria2c -S /tmp/torrent > /tmp/torrent_info
squashfs_file="$(sed -n '/idx|path\/length/,${s/\s*1|\(.*\)$/\1/p}' /tmp/torrent_info)"
image_size_bytes="$(sed -n 's/Total Length: .*(\([0-9,]*\)).*$/\1/p' /tmp/torrent_info | tr -d ',')"
torrent_name="$(sed -n 's/^Name: \(.*\)$/\1/p' /tmp/torrent_info)"