3.3.3 Aria2客户端AriaNg
AriaNg is a modern web frontend making aria2 easier to use. AriaNg is written in pure html & javascript, thus it does not need any compilers or runtime environment. You can just put AriaNg in your web server and open it in your browser. AriaNg uses responsive layout, and supports any desktop or mobile devices.
AriaNg_deploy.sh
#!/bin/bash
# deploy AriaNg in unbuntu
# Author: Scott Xiong
# write in Jun 19, 2019
cd
unzip_path=/usr/bin/unzip
ariang_path=$(find / -name robots.txt)
function check_unzip(){
[[ ! -e $unzip_path ]] && echo "ariang的部署,需要unzip模块,检测到unzip未安装,正在为您安装" && apt install unzip
echo "检测到unzip已安装,无需再安装.."
}
function install_ariang(){
read -p "你想部署的位置是(default:/mnt/ariang):" deploy_path
if [[ -z $deploy_path ]]; then
deploy_path=/mnt/ariang
fi
if [[ $benchmark_path ]]; then
#statements
deploy_path=$deploy_path
fi
echo "AriaNg将部署在:${deploy_path}"
check_unzip;
mkdir -p $deploy_path
cd $deploy_path
wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/1.0.0/AriaNg-1.0.0.zip
unzip AriaNg*
rm -rf AriaNg-1.0.0.zip
echo "AriaNg部署完毕,path为:${deploy_path}"
}
if [[ ! -z $ariang_path ]]; then
#statements
echo "AriaNg已安装,AriaNg安装目录为:"
find / -name robots.txt | awk -F "robots.txt" '{print $1}'
read -p "需要覆盖吗[y/n]" ariang_answer
if [[ $ariang_answer = 'y' || $ariang_answer = 'Y' || $ariang_answer = 'yes' || $ariang_answer = 'YES' ]]; then
#statements
n=0
find / -name robots.txt > scott.txt
for x in `awk '{print $1}' scott.txt`
{
((n++))
dir=$(dirname $x)
echo "正在清除目录$dir"
rm -rf $dir
}
rm -rf scott.txt
echo "共清除$n个历史版本"
install_ariang;
fi
else
echo "未检测到AriaNg的安装"
install_ariang;
fi