Autostart At Start-Up?

#1

Hi All,

I have created a short script to start my VPN.
I have made this executable by issuing the: chmod +x myscript.py

Now, I want this to autostart when I power up the Pi.
The Pi has OSMC/Kodi installed.

How would I best achieve this?

#2

Hi,

You could add it as a cronjob:

https://learn.pimoroni.com/tutorial/sandyj/running-scripts-at-boot

But if you are using openvpn, this already has a systemd startup script. I can provide more details if it is openvpn.

Thanks Tom.

#3

Hey Tom,

Thanks mate, much appreciated.
I use ExpressVPN which I believe OpenVPN is a spin-off of.

Pete

#4

Hi,

Just found your other topic, did you use the Brian Hornsby kodi addon in the end?

It may be easier to post the contents of myscript.py

Thanks Tom.

#5

OK Tom,

It is as straight forward as:

expressvpn connect

Pete

#6

Hi,

Looks like you are using expressvpn’s own app. Probably best to set up a cronjob.

Thanks Tom.