Auto connect VPN script on linux at boot
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 attackI use this code to add administrator property to my script:
sudo chmod +x scriptVPN.shI 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