-while [ ! -e "mnt/$file" ]; do sleep 1; done
-pv -f "mnt/$file" | md5sum -c <(cat <<EOF
-083e808d56aa7b146f513b3458658292 -
-EOF)
+
+GOPPROF=http godo -v -- "$repopath/fs/cmd/torrentfs" -mountDir=mnt -metainfoDir=torrents &
+torrentfs_pid=$!
+trap "kill $torrentfs_pid" EXIT
+
+check_file() {
+ while [ ! -e "mnt/$file" ]; do sleep 1; done
+ pv -f "mnt/$file" | md5sum -c <(cat <<-EOF
+ 083e808d56aa7b146f513b3458658292 -
+ EOF
+ )
+}
+
+( check_file ) &
+
+wait -n
+status=$?