Re: user level dispatcher for NM



On Thu, 2007-12-13 at 07:23 +0100, bremner unb ca wrote:
> Hi All;
> 
> Like several people out there, I wanted to have user (non-root)
> scripts run when NM changed state.
> 
> I decided to write a quick python script to snoop the dbus, and call 
> a function when an interface is brought up or down. Maybe somebody
> else will find this useful.

Cool!  It does look useful, yes.  I wonder if this functionality
shouldn't be built into the applet (with asynchronous dispatching, of
course) or something like that to stem the proliferation of daemons :)
In any case, this sort of thing is quite useful.

Dan

> Instead of a director of scripts, just place a file called
> .nmdispatchrc in the home directory, containing python code which
> defines functions ifup and ifdown. e.g.
> 
> def ifup(interface,*args)
>     print 'interface '+interface 'brought up'
> 
> def ifdown(interface,*args)
>     print 'interface '+interface+ ' brought down'
> 
> you will need dbus-python
> 
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]