Auto update tracker list of aria2 config in Mac OSX
auto_update.sh
Aria2 Mac Os App
Aria2 is an open source and free lightweight multi-protocol & multi-server command-line download utility for Windows, Linux and Mac OSX. It has an ability to download files from multiple protocols and sources including HTTP/HTTPS, FTP, BitTorrent and Metalink. Install aria2 on Mac OSX. June 23, 2017 Amber. App name: aria2; App description: Download with resuming and segmented downloading. Fitbit Aria 2 is the Wireless Smart Scale that uses advanced technology to measure weight, body fat percentage, and body mass index (BMI) to help you take control of your fitness. What's the difference between 'lean' and 'regular' mode? What does Aria 2 measure? How many people can use my Aria 2? Aria2GUI is used by 37 users of Mac Informer. The most popular version of this product among our users is 1.4. The product will soon be reviewed by our informers.
Aria2 Github
#!/bin/bash |
DAEMON=/usr/local/Cellar/aria2/1.31.0/bin/aria2c |
PID_NAME=aria2c |
PID=$(ps ux | awk '/aria2c/ && !/awk/ {print $2}') |
CONFIG_PATH='/path/to/aria2.conf' |
TRACKER_URL='https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_ip.txt' |
##### |
check_running() { |
PID=`ps ux | awk '/aria2c/ && !/awk/ {print $2}'` |
if [ -z$PID ];then |
return 1 |
else |
return 0 |
fi |
} |
do_update() { |
list=`wget -qO- $TRACKER_URL|sed '/^$/d'|perl -pe 'chop if eof'|tr 'n'','` |
if [ -z'`grep 'bt-tracker'$CONFIG_PATH`' ];then |
echo -e 'nbt-tracker=${list}'>>${CONFIG_PATH} |
echo'bt-tracker added!' |
else |
sed -i '''s@^bt-tracker.*@bt-tracker=$list@g'${CONFIG_PATH} |
echo'bt-tracker updated!' |
fi |
do_restart |
} |
do_start() { |
if check_running;then |
echo'$PID_NAME (pid $PID) is already running...' |
return 0 |
fi |
$DAEMON |
if check_running;then |
echo'Starting $PID_NAME success' |
else |
echo'Starting $PID_NAME failed' |
RET_VAL=1 |
fi |
} |
do_stop() { |
if check_running;then |
kill -9 $PID |
echo'Stopping $PID_NAME success' |
else |
echo'$PID_NAME is stopped' |
RET_VAL=1 |
fi |
} |
do_restart() { |
do_stop |
do_start |
} |
do_status() { |
check_running |
case$?in |
0) |
echo'$PID_NAME (pid $PID) is running...' |
;; |
1) |
echo'$PID_NAME is stopped' |
RET_VAL=1 |
;; |
esac |
} |
case'$1'in |
start|stop|restart|status|update) |
do_$1 |
;; |
*) |
echo'Usage: $0 { start | stop | restart | status |update }' |
RET_VAL=1 |
;; |
esac |
exit$RET_VAL |
Aria2gui Mac
![Terminal Terminal](https://jpg.macz.com/pic/201908/26085839_ec8d395100.png)
Aria2 Mac Binary
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment