1.首先,保证root目录下的空间充足,然后使用命令将所需的文件及依赖库放进去:(方法是:配置主机静态IP,如:192.168.1.66。然后打开tftp32软件,更改目录为文件所在目录和IP相对应静态IP,
tftp -g -l $1 -r $1 192.168.1.66
注:$1代表着每一个文件的名称)
root@OpenWrt:/tmp# opkg install aria2_1.18.7-1_ramips_24kec.ipk e2fsprogs_1.42.4-1_ramips_24kec.ipk fdisk_2.24.1-1_ramips_24kec.ipk
libblkid_2.24.1-1_ramips_24kec.ipk libstdcpp_4.8-linaro-1_ramips_24kec.ipk yaaw_2014-03-01-1_all.ipk
Installing aria2 (1.18.7-1) to root...
Installing libstdcpp (4.8-linaro-1) to root...
Installing e2fsprogs (1.42.4-1) to root...
Installing fdisk (2.24.1-1) to root...
Installing libblkid (2.24.1-1) to root...
Package libblkid (2.24.1-1) installed in root is up to date.
Package libstdcpp (4.8-linaro-1) installed in root is up to date.
Installing yaaw (2014-03-01-1) to root...
Configuring libblkid.
Configuring libstdcpp.
Configuring e2fsprogs.
Configuring aria2.
Configuring yaaw.
Configuring fdisk.
root@OpenWrt:/mnt/aria2# fdisk -l
Disk /dev/mtdblock7: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@OpenWrt:/mnt/aria2# mkfs.ext4 /dev/mtdblock7
mke2fs 1.42.4 (12-June-2012)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
16 inodes, 64 blocks
3 blocks (4.69%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
16 inodes per group
Allocating group tables: done
Writing inode tables: done
Filesystem too small for a journal
Writing superblocks and filesystem accounting information: done
root@OpenWrt:/mnt/aria2# mount -t ext4 /dev/mtdblock7 /mnt/aria2 / -o sync,rw
[ 4393.728000] EXT4-fs (mtdblock7): mounted filesystem without journal. Opts: (null)
root@OpenWrt:/etc/config# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/tmp/root)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/mtdblock7 on /mnt/aria2 type ext4 (rw,sync,relatime)
root@OpenWrt:/tmp# aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all -c -D
第二种方法:
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
rpc-allow-origin-all=true
#允许非外部访问
rpc-listen-all=true
#RPC端口, 仅当默认端口被占用时修改
#rpc-listen-port=6800
#最大同时下载数(任务数), 路由建议值: 3
max-concurrent-downloads=10
#断点续传
continue=true
#同服务器连接数
max-connection-per-server=10
#最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要
min-split-size=10M
#单文件最大线程数, 路由建议值: 5
split=10
#下载速度限制
max-overall-download-limit=0
#单文件速度限制
max-download-limit=0
#上传速度限制
max-overall-upload-limit=0
#单文件速度限制
max-upload-limit=0
#断开速度过慢的连接
#lowest-speed-limit=0
#验证用,需要1.16.1之后的release版本
#referer=*
input-file=/home/rescue01/Downloads/aria2.session
save-session=/home/rescue01/Downloads/aria2.session
#定时保存会话,需要1.16.1之后的release版
#save-session-interval=60
#文件保存路径, 默认为当前启动位置
dir=/home/rescue01/Downloads
#文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本
#disk-cache=0
#另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本(?)
#enable-mmap=true
#文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长
#所需时间 none < falloc ? trunc << prealloc, falloc和trunc需要文件系统和内核支持
file-allocation=prealloc
#启用本地节点查找
bt-enable-lpd=true
#添加额外的tracker
#bt-tracker=,…
#单种子最大连接数
#bt-max-peers=55
#强制加密, 防迅雷必备
#bt-require-crypto=true
#当下载的文件是一个种子(以.torrent结尾)时, 自动下载BT
follow-torrent=true
#BT监听端口, 当端口屏蔽时使用
#listen-port=6881-6999
#不确定是否需要,为保险起见,need more test
enable-dht=false
bt-enable-lpd=false
enable-peer-exchange=false
#修改特征
user-agent=uTorrent/2210(25130)
peer-id-prefix=-UT2210-
#修改做种设置, 允许做种
seed-ratio=0
#保存会话
force-save=true
bt-hash-check-seed=true
bt-seed-unverified=true
bt-save-metadata=true
#定时保存会话,需要1.16.1之后的某个release版本(比如1.16.2)
#save-session-interval=60
aria2c --conf-path=/mnt/aria2/aria2.conf -D
可以读取配置文件在后台运行
root@OpenWrt:/mnt/aria2# ls
aria2.conf aria2.log aria2.session lost+found
root@OpenWrt:/mnt/aria2# aria2c --conf-path=/mnt/aria2/aria2.conf -c
01/01 09:22:52 [WARN] Unknown option: max-upload-limit=0
01/01 09:22:52 [WARN] Unknown option: bt-enable-lpd=true
01/01 09:22:52 [WARN] Unknown option: follow-torrent=true
01/01 09:22:52 [WARN] Unknown option: enable-dht=false
01/01 09:22:52 [WARN] Unknown option: bt-enable-lpd=false
01/01 09:22:52 [WARN] Unknown option: enable-peer-exchange=false
01/01 09:22:52 [WARN] Unknown option: peer-id-perfix=-UT2210-
01/01 09:22:52 [WARN] Unknown option: seed-retio=0
01/01 09:22:52 [WARN] Unknown option: bt-hash-check-seed=true
01/01 09:22:52 [WARN] Unknown option: bt-seed-unverified=true
01/01 09:22:52 [WARN] Unknown option: bt-save-metadata=true
01/01 09:22:52 [WARN] Neither --rpc-secret nor a combination of --rpc-user and --rpc-passwd is set. This is insecure. It is extremely recommended to specify --rpc-secret with the adequate secrecy or now deprecated --rpc-user and --rpc-passwd.
01/01 09:22:52 [NOTICE] IPv4 RPC: listening on TCP port 6800
01/01 09:22:52 [NOTICE] IPv6 RPC: listening on TCP port 6800
然后在弹出的页面中选择设置,在弹出的小窗口中的path栏,填上http://路由器地址:6800/jsonrpc(在内网下),保存,选中你想要下载的文件然后点击“批量导出->YAAW”,路由器就可以开启下载了。