Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Auto connect VPN script on linux at boot

Writer Andrew Henderson

I'm writing a bash script on linux to run at each boot. This script serves to connect automatically on a surfshark vpn server at boot.

This is my script:

#! /bin/bash
echo "1"|sudo surfshark-vpn attack

I use this code to add administrator property to my script:

sudo chmod +x scriptVPN.sh

I use different guide to run this script on boot but none of these work. Can you help me?

2 Answers

As an alternative you can create a systemd unit file which will accomplish the task at boot.

Update your shell script to:

#! /bin/bash echo -e "\n" | sudo surfshark-vpn attack

echo -e (with -e) allows the command echo to interpret backslash escapes i.e. it will press 'enter' after sudo surfshark-vpn attack

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy