Possible Duplicate:
How can I capture network traffic of a single process?
I want to write a script which start/resume downloading big file using a download manager say wget only if the browser [say firefox] is not loading anything [actively not using internet].
How can i check from a script whether a process actively using internet or not ?
ss -p will give the connected process but can't say wheter they are active or not
nethogs is a visual solution but i can't use it in script due to its dynamic nature