Skip to content

Commit 0b27c9d

Browse files
committed
Allow resuming of interrupted downloads if databases and createtaxdb
1 parent 25fc210 commit 0b27c9d

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

data/workflow/createtaxdb.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,22 @@ downloadFile() {
4040
ARIA)
4141
FILENAME=$(basename "${OUTPUT}")
4242
DIR=$(dirname "${OUTPUT}")
43-
aria2c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "$FILENAME" -d "$DIR" "$URL" && return 0
43+
if aria2c -c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "${FILENAME}.aria2" -d "$DIR" "$URL"; then
44+
mv -f -- "${OUTPUT}.aria2" "${OUTPUT}"
45+
return 0
46+
fi
4447
;;
4548
CURL)
46-
curl -o "$OUTPUT" "$URL" && return 0
49+
if curl -L -C - -o "${OUTPUT}.curl" "$URL"; then
50+
mv -f -- "${OUTPUT}.curl" "${OUTPUT}"
51+
return 0
52+
fi
4753
;;
4854
WGET)
49-
wget -O "$OUTPUT" "$URL" && return 0
55+
if wget -O "${OUTPUT}.wget" -c "$URL"; then
56+
mv -f -- "${OUTPUT}.wget" "${OUTPUT}"
57+
return 0
58+
fi
5059
;;
5160
esac
5261
done

data/workflow/databases.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,22 @@ downloadFile() {
4040
ARIA)
4141
FILENAME=$(basename "${OUTPUT}")
4242
DIR=$(dirname "${OUTPUT}")
43-
aria2c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "$FILENAME" -d "$DIR" "$URL" && return 0
43+
if aria2c -c --max-connection-per-server="$ARIA_NUM_CONN" --allow-overwrite=true -o "${FILENAME}.aria2" -d "$DIR" "$URL"; then
44+
mv -f -- "${OUTPUT}.aria2" "${OUTPUT}"
45+
return 0
46+
fi
4447
;;
4548
CURL)
46-
curl -L -o "$OUTPUT" "$URL" && return 0
49+
if curl -L -C - -o "${OUTPUT}.curl" "$URL"; then
50+
mv -f -- "${OUTPUT}.curl" "${OUTPUT}"
51+
return 0
52+
fi
4753
;;
4854
WGET)
49-
wget -O "$OUTPUT" "$URL" && return 0
55+
if wget -O "${OUTPUT}.wget" -c "$URL"; then
56+
mv -f -- "${OUTPUT}.wget" "${OUTPUT}"
57+
return 0
58+
fi
5059
;;
5160
esac
5261
done

0 commit comments

Comments
 (0)