Last active
August 29, 2015 13:55
-
-
Save syphoxy/8747015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
headerString = "" | |
footerString = "" | |
inactiveCount = 0 | |
split("", inactiveTorrents) | |
activeCount = 0 | |
split("", activeTorrents) | |
} | |
$1 == "ID" { | |
headerString = $0 | |
} | |
$1 == "Sum:" { | |
footerString = $0 | |
} | |
$1 != "ID" && $1 != "Sum:" { | |
if ($3 != "None" && $9 != "Idle") { | |
activeTorrents[activeCount++] = $0 | |
} | |
if ($3 == "None" || ($3 != "None" && $9 == "Idle")) { | |
inactiveTorrents[inactiveCount++] = $0 | |
} | |
} | |
END { | |
print "Active Torrents:" | |
print "" | |
if (activeCount > 0) { | |
print " "headerString | |
for (j = 0; j < activeCount; j++) { | |
print " "activeTorrents[j] | |
} | |
# print " "footerString | |
} else { | |
print " Nothing to show here." | |
} | |
print "" | |
print "Inactive Torrents:" | |
print "" | |
if (inactiveCount > 0) { | |
print " "headerString | |
for (j = 0; j < inactiveCount; j++) { | |
print " "inactiveTorrents[j] | |
} | |
# print " "footerString | |
} else { | |
print " Nothing to show here." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment