Thank you.
I mean, I've been able to make it work. What I would like now is to make it initiate when booting, in stead of typing the command in a terminal screen.
I have found a script that explains how to run automatically openvpn during the system startup and I'm trying to adapt it to my own network and device. But I get an error message and I wonder if the problem is:
- syntax
- misplaced
- privileges
To avoid transcription problems I have given the script the same name of the example (VPNConnection).
Then the only change to introduce in the example to fit with my openvpn configuration is at the line:
sudo openvpn config-filename-goes-here.ovpn
Since my openvpn config file name is proxpn.ovpn, this example line has been changed to:
sudo openvpn proxpn.ovpn.
The error message I get when running the script should explain what's wrong, but I'm not an expert. I only know a few very basic commands and I'm not able to understand what's wrong.
Could it be that the openvpn config file is misplaced?
I have pasted the script at the end of this post.
I test it with:
sudo /etc/init.d/VPNConnection start
And I get:
/etc/init.d/VPNConnection: 26: /etc/init.d/VPNConnection: stop}?: not found
#! /bin/sh
# /etc/init.d/VPNConnection
### BEGIN INIT INFO
# Short-Description: Simple script to start a program at boot
# Description: A simple script from http://www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
### END INIT INFO
# If you want a command to always run, put it here
# Carry out specific functions when asked to by the system
case “$1” in
start)
echo “Starting VPN Connection”
# Connect to the VPN
cd /etc/openvpn
sudo openvpn config-filename-goes-here.ovpn
;;
stop)
echo “Stopping VPN Connection”
# Disconnect
killall openvpn
;;
*)
echo “Usage: /etc/init.d/VPNConnection {start|stop}”
exit 1
;;
esac