#!/bin/bash set -exu __DIR__=$( cd "$(dirname "$0")" pwd ) cd ${__DIR__} # https://aria2.github.io/manual/en/html/aria2c.html#http-ftp-segmented-downloads # https://aria2.github.io/manual/en/html/aria2c.html # -with-config-file-path=/usr/local/php/etc # -U, --user-agent # aria2c -h # aria2c --conf-path=/etc/aria2/aria2.conf :< -x, --max-connection-per-server= -k, --min-split-size= -j, --max-concurrent-downloads= -i, --input-file= EOF user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36' test -f download_extension_urls.txt && aria2c -c -j 10 -s 10 -x 8 -k 10M --allow-overwrite=true --max-tries=30 --retry-wait=15 --user-agent=$user_agent \ -d extensions --input-file=download_extension_urls.txt mkdir -p source/extensions awk 'BEGIN { cmd="cp -ri extensions/* source/extensions/" ; print "n" |cmd; }'