Skip to content

Instantly share code, notes, and snippets.

@lattice0
Last active July 17, 2018 23:18
Show Gist options
  • Save lattice0/d0c3880ccc48c86e357f49cffa091c32 to your computer and use it in GitHub Desktop.
Save lattice0/d0c3880ccc48c86e357f49cffa091c32 to your computer and use it in GitHub Desktop.
proton VPN mass import
#First import all the files
for i in *.ovpn; do nmcli connection import file "$i" type openvpn; done
#Now save the script below on some location:
#!/bin/bash
# Changes password-flags from 1 to 0
sed -i 's/password-flags=1/password-flags=0/g' $1
# Adds in a username entry after reneg-seconds
sed -i '/reneg-seconds=0/a username=USERNAME_HERE' $1
# Adds in password into the config file after [vpn-secrets]
sed -i '/service-type=/a\
\
[vpn-secrets]' $1
sed -i '/\[vpn-secrets]/a password=PASSWORD_HERE' $1
#Now go to /etc/NetworkManager/system-connections
for i in "*"; do <script location> "$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment