View Single Post
Posts: 1,224 | Thanked: 1,763 times | Joined on Jul 2007
#31
You create a file (say /usr/local/bin/scriptname) with this content, make sure it is executable (with a command like)

chmod a+x /usr/local/bin/scriptname

First, you should run it to see if it does what you want.

If you are sure you want it to start at boot time, the easiest way is probably to create a file /etc/event.d/autodisconnect, containing:
Code:
description "Run a script to disconnect idle networks"

start on started icd2

console none

script
        /usr/local/bin/scriptname
end script
About the script itself:
It can be up to 10 minutes, if last transfer happens a few seconds after the sleep starts, because the next check will see this transfer.

I believe using received makes more sense, since sometime the network appears up, but the other side is not there. In that case applications might continually send data, but nothing will be received.

I don't know of a wiki explaining all this, but you seem to be on the right track for understanding. I can think of no better way to do it than looking at simple scripts, and playing with them. If you don't have a Linux desktop, search for "manual page" of each command you need to learn.
 

The Following User Says Thank You to Matan For This Useful Post: