[Gllug] automatic networking scripts and exim

SteveC steve at fractalus.com
Wed Mar 30 15:45:11 UTC 2005


So I have a very old laptop with a dead screen and keyboard with debian
on it. It has a redeeming feature: it has a 6 hour (or longer) battery
life even when running a USB device and logging data occasionally (has
two battery slots).[1]

I have some software[1] which mails a file to me regularly (every hour
or two) on this laptop. It only mails a file if it has had success
collecting some data[1], eg its not guarenteed to send me 24 emails a day.
Its running exim3 right now in non-daemon mode (IIRC). It has a wifi and
a cat-5 ethernet pcmcia card. I would like

* if an email is sent, eg if exim has it, exim should never ever give
up sending it. I don't want timeout emails, just the real thing.

* if it sees a wifi network (eg iwconfig essid any) then to try to dhcp
and mail things. It should also try a couple of WEP'ed networks it knows
about occasionally, eg if it finds itself at home or work.

The network it sees might disappear before the email is sent.

My wifi card is currently on loan so I can't test things, but my plan
was this:

* set exim to auto_thaw = 1 minute? is that all I need?

* every minute, a bash script greps the access point MAC and checks if
its changed since it last checked. If it has, then
`/etc/init.d/network restart` and also run some script (which one?
something from /etc/cron.d?) to get exim to mail things

If the network is up, but has a low or 0 signal then tear down the
interface

* all this must survive random reboots or crashes (old laptop, no screen
or keyboard!) , so cron is the way I'm guessing.


This is all good, but I also want to minimise harddrive spin ups since
that eats battery. The scripts have to JustWork(TM) since the laptop has
no keyboard or screen working, but I might *occasionally* hook up a
monitor and PS/2 keyboard to check it out.

any ideas / tips / shellscript advice much appreciated!


[1] - its making GPS tracks from a USB GPS unit, its an old dell and the
wifi card unforunately needs ndiswrapper. see the wiki on
www.openstreetmap.org...

have fun,

SteveC steve at fractalus.com http://www.fractalus.com/steve/
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list