Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to execute a bash script after a TUN driver (e.g. tun0) is up under ubuntu 9.04/9.10. I need it to use the assigned VPN IP in some configuration scripts. Do you have any suggestion?

Thanks in advance,

Humber

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Look in the manual page for the --up cmd configuration entry. The script cmd is passed a whole lot of environment variables that tell it what is going on, and anything you might want to do is covered by those.

share|improve this answer
    
Thanks Andrew! That's exactly what I was looking for. Sorry for not looking at the man page first. In ubuntu 9.04, a init.d script named openvpn uses .conf files in /etc/openvpn to start a vpn process. I can edit edit that script and set OPTARGS with --up and --down directives. –  Humber Jan 6 '10 at 15:24

You can try the --up switch (on command lien) or the up directive (in config file). See the OpenVPN MAN page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.