Skip to content

Commit

Permalink
Fix value returned by rtgetTotalRotatingSize() if both directories ar…
Browse files Browse the repository at this point in the history
…e empty (Closes #99)
  • Loading branch information
chros authored and chros committed Jan 21, 2017
1 parent 79e5c16 commit 4b9ce04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ubuntu-14.04/home/chros73/.profile_rtfunctions
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ rtlistStopped () {

# get total size of rotating and unsafe torrents
rtgetTotalRotatingSize () {
$HOME/bin/rtcontrol --stats -qo size,name,alias "path=$RTHOME/rotating/*,$RTHOME/unsafe/*" OR custom_unsafe_data=2 | grep "SUM of" | sed "s# \[SUM of.*##"
local rotatingSize=$($HOME/bin/rtcontrol --stats -qo size,name,alias "path=$RTHOME/rotating/*,$RTHOME/unsafe/*" OR custom_unsafe_data=2 | grep "SUM of" | sed "s# \[SUM of.*##")
[[ -n "$rotatingSize" ]] && echo -e "$rotatingSize" || echo -e 0
}


0 comments on commit 4b9ce04

Please sign in to comment.