It's likely that vpnc-connect is a bash script that has been designed to gather the required connection information for the vpn client. The best way to achieve what you want is to modify the script to enter the information directly, instead of asking the questions about the connection data. To do this, use a text editor to view the script, and look for the areas where the questions are asked. (You will most likely need to open the text editor as root, as this file is probably a root-owned file.) They should look typically like:
Quote:
echo "Enter IPSec gateway address:"
|
You should see a
read command following that which puts the answer into a variable. What you need to do is to allocate the answer directly to the variable. For example, if the statements concerning the first question are:
Quote:
echo "Enter IPSec gateway address:"
read IPSec_gateway_address
|
then comment those lines out and add the direct variable assignment in the following line, like this:
Quote:
# echo "Enter IPSec gateway address:"
# read IPSec_gateway_address
IPSec_gateway_address="192.168.1.15"
|
The example uses a dummy IP Address and takes a guess at what the variable may be called; naturally, use whatever address is applicable to your system, and whatever variable name your vpnc-connect script uses. Continue on to complete the remainder of the questions, then you should be OK to use the script without user input. I would make sure the script is given strict permissions once the connection information is embedded in it. I would suggest:
Quote:
chmod 700 /usr/sbin/vpnc-connect
|
(assuming it is located in /usr/sbin on your system).
An excellent source of information on bash scripts, to help you with understanding how vpnc-connect works is
http://www.tldp.org/LDP/abs/html/index.html.