You are not logged in.

#1 2009-09-19 13:17:02

DavidR
Member
Registered: 2009-09-17
Posts: 34

lxterminal --command: How can I keep the window open? [SOLVED]

Hello,

I am trying to create an application launcher that will let me connect to my vpn account at start up instead of having to manually type the openvpn command each time my machine boots. I need to use sudo, but lxterminal disappears the instant it opens. I tried adding the read command as suggested here:http://ubuntuforums.org/showthread.php?t=192427, but it just doesn't work.

Any suggestions? Or alternatively, is there a way for me to start the vpn connection automatically at startup, preferably without even having to enter my password?

Here's my .desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=OpenVPN
Comment=Establish a secure connection
Icon=vpn
Exec=lxterminal --command="sudo openvpn --config /home/myhomefolder/.vpnkey/vpnfile.ovpn"
Terminal=false
Type=Application

Thanks!

Last edited by DavidR (2009-09-19 17:43:06)

Offline

#2 2009-09-19 14:05:49

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: lxterminal --command: How can I keep the window open? [SOLVED]

You can put that command in rc.local to run it at boot or in /etc/xdg/lxsession/LXDE/autostart to run it when LXDE starts.

Offline

#3 2009-09-19 15:30:57

DavidR
Member
Registered: 2009-09-17
Posts: 34

Re: lxterminal --command: How can I keep the window open? [SOLVED]

I tried adding it to /etc/rc.local, and according to the boot up messages it works, but the boot process just stops after OpenVPN opens the tunnel. OpenVPN doesn't terminate and I think that the startup process keeps waiting for bash to exit, but bash doesn't as it keeps waiting for the OpenVPN output. In other words, my machine stops booting.

Here's what I have in rc.local:

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
cd /home/homefolder/.vpnkey
openvpn --config vpn.ovpn

Offline

#4 2009-09-19 17:42:41

DavidR
Member
Registered: 2009-09-17
Posts: 34

Re: lxterminal --command: How can I keep the window open? [SOLVED]

Fixed by adding and & to the rc.local command and redirecting the output to a textfile that's located in my home directory.

Thanks for your help!

Offline

Board footer

Powered by FluxBB