maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Openvpn on connection start (https://talk.maemo.org/showthread.php?t=69529)

mase 2011-02-08 19:00

Openvpn on connection start
 
Hi!
How can I start openvpn automatically, when a connection was
established? Best would be a connection-specific script to run.
I want to start openvpn on any connection, but not when connected
to my home lan. At the moment I am using the openvpn-gui, but
I always have to do that manually.

Viqsi 2011-02-08 20:15

Re: Openvpn on connection start
 
Presumably something with dbus-scripts would allow this, but beyond that I'm not sure where to begin.

lidow 2011-02-08 20:28

Re: Openvpn on connection start
 
I've put a script in /etc/network/if-up.d that is doing this, without dbus staff.

sjgadsby 2011-02-08 20:30

Re: Openvpn on connection start
 
Quote:

Originally Posted by mase (Post 939268)
How can I start openvpn automatically, when a connection was established? Best would be a connection-specific script to run. I want to start openvpn on any connection, but not when connected
to my home lan. At the moment I am using the openvpn-gui, but
I always have to do that manually.

You might try writing a script for placement in /etc/network/if-up.d/. Compare the output of
Code:

/usr/bin/gconftool -g \
"/system/osso/connectivity/IAP/$ICD_CONNECTION_ID/name"

against your home WiFi network's name and launch OpenVPN for any connection that doesn't match.

mase 2011-02-08 21:01

Re: Openvpn on connection start
 
I know /etc/ppp/ip-up.d from my Debian system. This doesn't
exist in Maemo. Does /etc/network/if-up.d include the dialup
network?

sjgadsby 2011-02-08 21:15

Re: Openvpn on connection start
 
Quote:

Originally Posted by mase (Post 939378)
I know /etc/ppp/ip-up.d from my Debian system. This doesn't
exist in Maemo. Does /etc/network/if-up.d include the dialup
network?

By dialup, do you mean GPRS? If so, yes, the scripts in /etc/network/if-up.d are run for those connections. In fact, if you look at the existing scripts there, you'll notice blocks such as:
Code:

if [ "$ICD_CONNECTION_TYPE" != GPRS ]; then
    exit 0
fi


mase 2011-02-09 18:10

Re: Openvpn on connection start
 
I did it this way:
http://talk.maemo.org/showpost.php?p=572440&postcount=2

rajil.s 2011-02-09 19:11

Re: Openvpn on connection start
 
The init script sends the openvpn log to syslog. I would rather use the openvpn applet for graphical feedback as requested here.

mase 2011-02-10 04:03

Re: Openvpn on connection start
 
Yes, but the question stays. Can I control the applet via commandline?


All times are GMT. The time now is 19:25.

vBulletin® Version 3.8.8