On Tue, Jan 05, 2010 at 07:47:05AM +1300, martin f krafft wrote: > also sprach Jose Calhariz <jose.calha...@tagus.ist.utl.pt> [2010.01.05.0723 > +1300]: > > In my use cases I have find other ways for running code for > > different "LOCATION". > > What do you use?
On my laptop I use switchconf to change /etc/network/interfaces for the various locations. I use "pre-up", "post-up", "pre-down" and "post-down" to mount/umount nfs filesystems and to start/stop VPN connections. > > > Usually you need to run things before and after the change. Instead > > of creating a new directory to store scripts. Why not recycle > > before.d and after.d? During the switch, file > > /var/lib/misc/switchconf.lastcfg have the name of the old conf. > > If I start calling the scripts with the new conf. You have all the > > information you may need: > > - $1=NextConf > > - `cat /var/lib/misc/switchconf.lastcfg`=OldConf. > > Sure, that would work. > Jose Calhariz -- -- O olho do homem serve de fotografia ao invisível, como o ouvido serve de eco ao silêncio. -- Machado de Assis (Esaú e Jacó) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org