Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
buzz_dude
OpenVpn Newbie
Posts: 5
Joined: Sat Jul 30, 2016 12:09 pm

Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by buzz_dude » Sat Jul 30, 2016 12:19 pm

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:

Code: Select all

sudo su
The script i am trying to get to work is from the following guide: https://dotslashnotes.wordpress.com/201 ... -pi-linux/

Here is the script i have pasted to the file "VPNConnection":

Code: Select all

#! /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:

Code: Select all

sudo /etc/init.d/VPNConnection start
I get this following error:

Code: Select all

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 ;)

buzz_dude
OpenVpn Newbie
Posts: 5
Joined: Sat Jul 30, 2016 12:09 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by buzz_dude » Sat Jul 30, 2016 1:39 pm

buzz_dude wrote: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:

Code: Select all

sudo su
The script i am trying to get to work is from the following guide: https://dotslashnotes.wordpress.com/201 ... -pi-linux/

Here is the script i have pasted to the file "VPNConnection":

Code: Select all

#! /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:

Code: Select all

sudo /etc/init.d/VPNConnection start
I get this following error:

Code: Select all

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 ;)

To be more specific with the error its: /etc/init.d/VPNConnection: 26: /etc/init.d/VPNConnection: stop}”:

Sorry :)

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by TinCanTech » Sun Jul 31, 2016 12:08 am

Your error is bogus.

buzz_dude
OpenVpn Newbie
Posts: 5
Joined: Sat Jul 30, 2016 12:09 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by buzz_dude » Sun Jul 31, 2016 10:21 am

TinCanTech wrote:Your error is bogus.
I am sorry?
That is the error that is returned to me when i try to test the script. Is there another place/log i should be looking at?

I am quite new to this, so i would not know what is a "bogus" error or not. Thanks for the answer though.. :?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by TinCanTech » Sun Jul 31, 2016 6:17 pm

Have you made the file executable ?

buzz_dude
OpenVpn Newbie
Posts: 5
Joined: Sat Jul 30, 2016 12:09 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by buzz_dude » Sun Jul 31, 2016 7:24 pm

TinCanTech wrote:Have you made the file executable ?
Yes, i did - thank you :)

I used the command here provided by the guide:

Code: Select all

sudo chmod 755 /etc/init.d/VPNConnection

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by TinCanTech » Sun Jul 31, 2016 8:12 pm

buzz_dude wrote:The script i am trying to get to work is from the following guide: https://dotslashnotes.wordpress.com/201 ... -pi-linux/
Looks like you will have to raise a bug report with the author.

buzz_dude
OpenVpn Newbie
Posts: 5
Joined: Sat Jul 30, 2016 12:09 pm

Re: Error on rasbian Jessie open vpn start script: sudo /etc/init.d/VPNConnection: stop": not found

Post by buzz_dude » Mon Aug 01, 2016 5:07 pm

TinCanTech wrote:
buzz_dude wrote:The script i am trying to get to work is from the following guide: https://dotslashnotes.wordpress.com/201 ... -pi-linux/
Looks like you will have to raise a bug report with the author.
I am afraid that's it's going to be hard to get a hold of him.
If anyone gets a chance to test the script above out, it would be much appreciated :). Also, if anyone knows a script with pretty much the same function, do let me know. I will be looking around for it anyways..

Thanks for the help btw!

Post Reply