Linux Open VPN Script stops - quits
Posted: Tue Oct 26, 2010 12:35 pm
I have searched the web, and the forums for the past few days and can't seem to get anyplace with what im trying to do. Sorry if this isn't the right thread but its for the vpn. I just started to learn bash scripting (specifically for this). My goal is to make it really simple for people to start the connection to the server with a double click.
I have a fedora machine that i want to be able to connect to an hda server. What i did is setup a "vpn" folder on the hard drive (/vpn). I put the certs and the key and everything i need to start the connection process in that folder. So what i would do if i were to open terminal is type
cd /vpn
openvpn --config myvpn.conf --auth-user-pass credentials
this makes it so i dont need to input my username and password.
On to the scripting part.
I created a bash script call script.sh that i put on the desktop. It seems to work just fine, i enabled it to be executable with chmod and everything. I run it and tell it to open in terminal. I watch the vpn process happen and know that its connecting and everything but once the script is complete (once it is done with that command) the terminal windows quits and in doing this it terminates the connection.
so you know what my script looks like here you go.
#!/bin/bash
cd /vpn
openvpn --config myvpn.conf --auth-user-pass credentials
so my question is, does anyone have an idea of what command i can give to keep the window alive. I have tried give a read command at the end (suggested from other forums) and i know it doesn't really exist in the bash but i tried a keepalive. Like i said i just started learning this stuff and want to keep at it. Any suggestions would help. Thank you.
I have a fedora machine that i want to be able to connect to an hda server. What i did is setup a "vpn" folder on the hard drive (/vpn). I put the certs and the key and everything i need to start the connection process in that folder. So what i would do if i were to open terminal is type
cd /vpn
openvpn --config myvpn.conf --auth-user-pass credentials
this makes it so i dont need to input my username and password.
On to the scripting part.
I created a bash script call script.sh that i put on the desktop. It seems to work just fine, i enabled it to be executable with chmod and everything. I run it and tell it to open in terminal. I watch the vpn process happen and know that its connecting and everything but once the script is complete (once it is done with that command) the terminal windows quits and in doing this it terminates the connection.
so you know what my script looks like here you go.
#!/bin/bash
cd /vpn
openvpn --config myvpn.conf --auth-user-pass credentials
so my question is, does anyone have an idea of what command i can give to keep the window alive. I have tried give a read command at the end (suggested from other forums) and i know it doesn't really exist in the bash but i tried a keepalive. Like i said i just started learning this stuff and want to keep at it. Any suggestions would help. Thank you.