summaryrefslogtreecommitdiffstats
path: root/downloadStats
blob: 4b206e79b9269fcdd40096b79c2777932f4ce3d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/zsh
#setopt shwordsplit
ariaStats=$(aria2mon | grep GID | perl -lne 'print $1 if /(ETA:.+)/') || ""
torrentStats=$(~/.rtorrent/torrentStats ~/.rtorrent/xmlrpc2scgi.py ~/.rtorrent/rpc.socket 2>/dev/null | grep "Done:" | cut -d " " -f 2 | sed -e 's/^/:/' ) || ""
([[ ! -z $ariaStats ]] || [[ ! -z $torrentStats ]]) && echo "${ariaStats} \\ ${torrentStats}"
if [[ (! -t 1) && -z $1 ]];then
    exit 0
fi

if [[ -z $ariaStats && -z $torrentStats ]];then
    exit 1
else
    exit 0
fi
    #set +x