mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
change path scheme of adoptopenjdk
This commit is contained in:
parent
eb281cc2b0
commit
67e31a907b
@ -7,10 +7,10 @@ BASE_PATH="${TUNASYNC_WORKING_DIR}"
|
||||
# 参数为版本,比如8,11等
|
||||
function downloadRelease() {
|
||||
curl -s "https://api.adoptopenjdk.net/v2/latestAssets/releases/openjdk$1" | \
|
||||
jq -r '.[]| [.version,.binary_type,.architecture,.os,.openjdk_impl,.binary_name,.binary_link,.checksum_link]| @tsv' | \
|
||||
while IFS=$'\t' read -r version binary_type architecture os openjdk_impl binary_name binary_link checksum_link; do
|
||||
mkdir -p "$BASE_PATH/$version/$binary_type/$architecture/$os/$openjdk_impl/" || true
|
||||
dest_filename="$BASE_PATH/$version/$binary_type/$architecture/$os/$openjdk_impl/$binary_name"
|
||||
jq -r '.[]| [.version,.binary_type,.architecture,.os,.binary_name,.binary_link,.checksum_link]| @tsv' | \
|
||||
while IFS=$'\t' read -r version binary_type architecture os binary_name binary_link checksum_link; do
|
||||
mkdir -p "$BASE_PATH/$version/$binary_type/$architecture/$os/" || true
|
||||
dest_filename="$BASE_PATH/$version/$binary_type/$architecture/$os/$binary_name"
|
||||
declare downloaded=false
|
||||
if [[ -f $dest_filename ]]; then
|
||||
sha256sum_check && {
|
||||
@ -19,11 +19,12 @@ function downloadRelease() {
|
||||
}
|
||||
fi
|
||||
while [[ $downloaded != true ]]; do
|
||||
rm ${dest_filename} ${dest_filename}.sha256.txt || true
|
||||
timeout -s INT 300 wget ${WGET_OPTIONS:-} -q \
|
||||
echo "Downloading ${dest_filename}"
|
||||
rm ${dest_filename} ${dest_filename}.sha256.txt 2>/dev/null || true
|
||||
wget -t 2 -T 30 ${WGET_OPTIONS:-} \
|
||||
-O "${dest_filename}" \
|
||||
"$binary_link"
|
||||
timeout -s INT 300 wget ${WGET_OPTIONS:-} -q \
|
||||
wget -t 2 -T 30 ${WGET_OPTIONS:-} \
|
||||
-O "${dest_filename}.sha256.txt" \
|
||||
"$checksum_link"
|
||||
sha256sum_check && {
|
||||
|
Loading…
x
Reference in New Issue
Block a user