Hi.
I have got openvpn working with PIA vpn, but i am having some issues trying to get a startup script working for the vpn.
I am trying to run it on Rasbian Jessie (latest version) for my raspberry pi 3b.
I am in "su mode" using the command:
sudo su
The script i am trying to get to work is from the following guide:
https://dotslashnotes.wordpress.com/2013/08/07/how-to-run-a-command-automatically-at-system-boot-in-raspberry-pi-linux/
Here is the script i have pasted to the file "VPNConnection":
#! /bin/sh
# /etc/init.d/VPNConnection
### BEGIN INIT INFO
# Short-Description: Simple script to start a program at boot
# Description: A simple script from Dotslashnotes
### 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 Sweden.ovpn
;;
stop)
echo “Stopping VPN Connection”
# Disconnect
killall openvpn
;;
*)
echo “Usage: /etc/init.d/VPNConnection {start|stop}”
exit 1
;;
esac
When i run it using the command:
sudo /etc/init.d/VPNConnection start
I get this following error: sudo /etc/init.d/VPNConnection: stop": not found
Any help i can get i very appreciated! And i apologize for any misunderstanding, as i am quite new to this (also please let me know if this is posted in the wrong forum section).
- Buzz 😉