[openwrt/openwrt] scripts/download.pl: pass aria2 config in ENV only

LEDE Commits lede-commits at lists.infradead.org
Thu Oct 20 11:43:54 PDT 2022


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a53f29b583dd974b8b65737bab7fbca7753c738c

commit a53f29b583dd974b8b65737bab7fbca7753c738c
Author: Zhang Hua <zhanghuadedn at gmail.com>
AuthorDate: Sun Oct 2 19:04:12 2022 +0800

    scripts/download.pl: pass aria2 config in ENV only
    
    The aria2c command tries to load config from
    ${XDG_CONFIG_HOME:-${HOME}/.config}/aria2/aria2.conf by default,
    which may result unexpected behavior.
    
    As a replacement, people can use environment variable ARIA2C_OPTIONS
    to custom arguments passed to aria2c like curl and wget below.
    Including --conf-path=/path/to/config.conf in ARIA2C_OPTIONS can
    also set a custom config file path easily if needed.
    
    Signed-off-by: Zhang Hua <zhanghuadedn at gmail.com>
---
 scripts/download.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/download.pl b/scripts/download.pl
index 79ad8bfea0..0b3f99e9b0 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -129,6 +129,7 @@ sub download_cmd {
 			$check_certificate ? () : '--check-certificate=false',
 			"--server-stat-of=$ENV{'TMPDIR'}/aria2c/${rfn}_spp",
 			"--server-stat-if=$ENV{'TMPDIR'}/aria2c/${rfn}_spp",
+			"--daemon=false --no-conf", shellwords($ENV{ARIA2C_OPTIONS} || ''),
 			"-d $ENV{'TMPDIR'}/aria2c -o $rfn;",
 			"cat $ENV{'TMPDIR'}/aria2c/$rfn;",
 			"rm $ENV{'TMPDIR'}/aria2c/$rfn $ENV{'TMPDIR'}/aria2c/${rfn}_spp");




More information about the lede-commits mailing list