Guest User

Untitled

a guest
Nov 26th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # for manual ovpn add of pia vpns
  4. # get pia ovpn profiles, load them using:
  5. # for i in *.ovpn; do nmcli connection import file "$i" type openvpn; done
  6. # then:
  7. # for i in "*"; do /root/Downloads/ovpn/pia_ovpn_mod.sh "$i"; done
  8.  
  9. # Changes password-flags from 1 to 0
  10. # sed -i 's/password-flags=1/password-flags=0/g' $1
  11.  
  12. sed -i 's/ca=\/root\/Downloads\/ovpn\/.\/ca.rsa.2048.crt/ca=\/etc\/NetworkManager\/pia\/ca.rsa.2048.crt/g' $1
  13.  
  14. # Adds in a username entry after reneg-seconds
  15. sed -i '/reneg-seconds=0/a username=username' $1
  16.  
  17. # remove trailing gateway
  18. sed -i '/:1198/a port=1198' $1
  19. sed -i 's/:1198//' $1
  20.  
  21. # replace bad ciphers
  22. sed -i 's/aes-128-cbc/AES-128-CBC/' $1
  23. sed -i 's/sha1/SHA1/' $1
  24.  
  25. # Adds in a section [vpn-secrets] for passwords after line 21
  26. # sed -i '21 a [vpn-secrets]' $1
  27.  
  28. # Adds in password into the config file after [vpn-secrets]
  29. # sed -i '/\[vpn-secrets]/a password=password' $1
  30.  
  31. # Adds in a new line after password=
  32. # sed -i '/password=/a\\' $1
Add Comment
Please, Sign In to add comment