Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

termux aria2 conf #5

Open
urain39 opened this issue Dec 11, 2019 · 2 comments
Open

termux aria2 conf #5

urain39 opened this issue Dec 11, 2019 · 2 comments

Comments

@urain39
Copy link
Collaborator

urain39 commented Dec 11, 2019

#!/bin/sh

set -e

ARIA2_DIR="/sdcard/aria2"
#ARIA2_FILE_ALLOCATION="none"
ARIA2_FILE_ALLOCATION="prealloc"
ARIA2_RPC_SECRET="thefox.chen"

# 初始化配置目录
umask 002 \
  && mkdir -p "${HOME}/.aria2" \
  && touch "${HOME}/.aria2/aria2.session"

# 下载最新的配置文件
curl -k -o "${HOME}/.aria2/aria2.conf" 'https://raw.githubusercontent.com/alcove-sh/nextcloud-alpine-3.10-nginx-sqlite3/master/aria2.conf.example'

# 关闭安卓不支持的特性与更改下载目录
sed -i \
  -e "s|^\\(dir=\\).\{1,\}\$|\\1${ARIA2_DIR}|" \
  -e "s|^\\(enable-mmap=\\)true\$|\\1false|" \
  -e "s|^\\(rpc-secret=\\).\{1,\}\$|\\1${ARIA2_RPC_SECRET}|" \
  -e "s|^\\(file-allocation=\\)falloc\$|\\1${ARIA2_FILE_ALLOCATION}|" \
  -e "s|/var/lib/aria2|${HOME}/.aria2|" \
  -e '$aenable-rpc=true' "${HOME}/.aria2/aria2.conf"
@urain39
Copy link
Collaborator Author

urain39 commented Jan 18, 2020

开启prealloc后再使用mmap好像还是会引起SIGBUS的问题,因此这里关闭了mmap功能。

@urain39
Copy link
Collaborator Author

urain39 commented Jul 16, 2020

考虑将这部分代码移到gitee上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant