Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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
Add Comment
Please, Sign In to add comment