longzuyuan / ics-openvpn

Automatically exported from code.google.com/p/ics-openvpn
0 stars 0 forks source link

up cmd not supported #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In the Custom Options menu, add the command: up 'echo up'
2.
3.

What is the expected output? What do you see instead?
The VPN connection is not set up.
In the OpenVPN Log, I see:
Assertion failed at openvpn//src/openvpn/misc.c:116

What mobile phone are you using?
Nexus S

Which Android Version and stock ROM or aftermarket like cyanogenmod?
Android 4.1.1

Please provide any additional information below.
If I add the 'up' in a config, it is not loaded.

Original issue reported on code.google.com by yannick....@gmail.com on 24 Sep 2012 at 3:46

GoogleCodeExporter commented 9 years ago
Problem is that open_tun that does not set the actual device name.  Calling the 
script needs the actual device name as parameter. 

Setting the actual real device name is rather compliacted I think I will 
something like "android-tun" instead of tun0/tun1.

Original comment by arne@rfc2549.org on 25 Sep 2012 at 2:52

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 5707247c7a95.

Original comment by arne@rfc2549.org on 25 Sep 2012 at 4:32

GoogleCodeExporter commented 9 years ago
A build with the change included can be found here: 
http://plai.de/android/icsopenvpn0523pre2.apk

Original comment by arne@rfc2549.org on 25 Sep 2012 at 4:33

GoogleCodeExporter commented 9 years ago
Thanks for the apk.
Now I have got a new problem:
MNGT:Got unrecognized command>FATAL:
WARNING:Failed running command (--up/--down): could not execute external program

My up command is: up 'echo up'

Original comment by yannick....@gmail.com on 26 Sep 2012 at 7:54

GoogleCodeExporter commented 9 years ago
Yes. OpenVPN is right. You probably don't have an echo program on your 
telephone. :)

Original comment by arne@rfc2549.org on 26 Sep 2012 at 8:12

GoogleCodeExporter commented 9 years ago
That's right.

I would like to launch an application when the VPN is up.

I've written a script that calls the 'am' command to start my application.
If I execute 'sh /sdcard/vpn.sh' from adb shell, it starts my application as 
expected.
But if I insert the command: up /sdcard/vpn.sh in the openvpn config, I've got 
the previous error.

How could I sort out this problem ?
Thanks.

Original comment by yannick....@gmail.com on 26 Sep 2012 at 8:56

GoogleCodeExporter commented 9 years ago
have you tried providing the full to sh?

Original comment by arne@rfc2549.org on 26 Sep 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Should have read full path.

Original comment by arne@rfc2549.org on 26 Sep 2012 at 9:04

GoogleCodeExporter commented 9 years ago
Latest news:

Now, I'm able to execute a script file.
To achieve that, I've added the following line in the config file:
   up "/system/bin/sh /sdcard/vpn.sh"

Hereafter is a copy of vpn.sh (3 lines)
#!/system/bin/mksh
export PATH=$PATH:/system/bin
am start -a android.intent.action.MAIN -n 
com.csipsimple/com.csipsimple.ui.SipHome

But my application is not started. It seems that openvpn has not the right to 
launch another application.

Original comment by yannick....@gmail.com on 26 Sep 2012 at 10:04