It would be nice if in a next tinc release you'll add some service variables tinc propagates to its scripts. So for example you can define in tinc.conf env variables like: SERVICE1... SERVICEn and tinc will propagates all SERVICEx Variables found in tinc.conf to all scripts it calls. One can use theoretically infinite Env Var for custom behavior (like custom debug messages, conditional iptables rules load or something else), without lot of coding for you. Using a multi separated scripts called on state change, as you choice, is right, but make difficult to set common env var if you don't make a tinc inside mechanism like that. This is only a suggestion, right ? Thank you Best Regards Roberto -----Original Message----- From: tinc [mailto:tinc-bounces at tinc-vpn.org] On Behalf Of Guus Sliepen Sent: luned? 25 gennaio 2016 17.23 To: tinc at tinc-vpn.org Subject: Re: Persistent tun/tap On Mon, Jan 25, 2016 at 03:49:44PM +0000, mlist wrote:> I read documentation about env variables, but those variables are all internal variables tinc inject about its component state/name, how can for example I can tell tinc to send $DEBUG state variable to each stage so I can write on system log custom messages in different stages ? It'd be very useful, instead of defining same variable on each different standard script (script scope variable).Tinc only sets those environment variables listed in the documentation. There is no $DEBUG variable or anything similar. -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org>
On Tue, Jan 26, 2016 at 07:25:55AM +0000, mlist wrote:> It would be nice if in a next tinc release you'll add some service variables tinc propagates to its scripts. > So for example you can define in tinc.conf env variables like: > > SERVICE1> ... > SERVICEn> > and tinc will propagates all SERVICEx Variables found in tinc.conf to all scripts it calls. One can use theoretically infinite Env Var for custom behavior (like custom debug messages, conditional iptables rules load or something else), without lot of coding for you. > > Using a multi separated scripts called on state change, as you choice, is right, but make difficult to set common env var if you don't make a tinc inside mechanism like that.I will not add this feature to tinc. You can easily do this yourself by adding these environment variables to a separate file, and sourcing it in the scripts that tinc calls. For example: /etc/tinc/netname/variables: SERVICE1=foo /etc/tinc/netname/tinc-up: #!/bin/sh . /etc/tinc/netname/variables echo SERVICE1=$SERVICE1 -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20160126/6a1114a5/attachment.sig>
On 26/01/16 09:13, Guus Sliepen wrote:> On Tue, Jan 26, 2016 at 07:25:55AM +0000, mlist wrote: I will not > add this feature to tinc. You can easily do this yourself by adding > these environment variables to a separate file, and sourcing it in > the scripts that tinc calls. For example:Does tinc clear the environment before calling the scripts? Or can you just define the environment variables you want before calling tincd? Graham