Skip to content

Instantly share code, notes, and snippets.

@Aviksaikat
Created April 6, 2023 10:13
Show Gist options
  • Save Aviksaikat/739b04fb85d4084ce508e807feb785b0 to your computer and use it in GitHub Desktop.
Save Aviksaikat/739b04fb85d4084ce508e807feb785b0 to your computer and use it in GitHub Desktop.
Tired of putting open vpn user id & pass again & again try this script
#!/bin/bash
VPN_USER="<yourUsername>"
VPN_PASSWORD="<yourPassword>"
CONFIG_FILE="./open_vpn_file.ovpn"
#sudo openvpn saikat.karmarkar-config.ovpn
sudo bash -c 'openvpn --config '"$CONFIG_FILE"' --auth-user-pass <(echo -e "'"$VPN_USER"'\n'"$VPN_PASSWORD"'")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment