daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Dec 29th, 2016 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. USERNAME="user0788750"
  4. PASSWORD="12bZ6B40"
  5.  
  6. PROTOCOL="tcp"
  7. # Add - delete - edit servers between ##BB## and ##EE##
  8. REMOTE_SERVERS="
  9. ##BB##
  10. #
  11. remote ro.torguardvpnaccess.com 443
  12. ##EE##
  13. "
  14.  
  15. #### DO NOT CHANGE below this line unless you know exactly what youre doing ####
  16.  
  17. CA_CRT="-----BEGIN CERTIFICATE-----
  18. MIIEwTCCA6mgAwIBAgIJAKROjebUHo0gMA0GCSqGSIb3DQEBBQUAMIGbMQswCQYD
  19. VQQGEwJVUzELMAkGA1UECBMCRkwxEDAOBgNVBAcTB09ybGFuZG8xETAPBgNVBAoT
  20. CFRvckd1YXJkMQwwCgYDVQQLEwNWUE4xEzARBgNVBAMTClRHLU9WUE4tQ0ExETAP
  21. BgNVBCkTCFRvckd1YXJkMSQwIgYJKoZIhvcNAQkBFhVzeXNhZG1pbkB0b3JndWFy
  22. ZC5uZXQwHhcNMTQwNDE3MTAwOTIzWhcNMjQwNDE0MTAwOTIzWjCBmzELMAkGA1UE
  23. BhMCVVMxCzAJBgNVBAgTAkZMMRAwDgYDVQQHEwdPcmxhbmRvMREwDwYDVQQKEwhU
  24. b3JHdWFyZDEMMAoGA1UECxMDVlBOMRMwEQYDVQQDEwpURy1PVlBOLUNBMREwDwYD
  25. VQQpEwhUb3JHdWFyZDEkMCIGCSqGSIb3DQEJARYVc3lzYWRtaW5AdG9yZ3VhcmQu
  26. bmV0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAws1hJzlbWKlm3DEO
  27. XyQpmvtxwrsR4CIYMi8C6np5w74lTRYmGBcuuPqAT3ig2DnH9HNNFx1WWZbYO8pU
  28. a1tdn7uYErJi4EP9/t2l3uXCNgoWYVdVP1j5EXIY1oacOv9srbNZHeWpxHIb1wZr
  29. 1i4sLsdaifOibgVZI91FATXGrVdFDaQb2OjyJrFW8b4xbC8pBJxQDzqPeu9mkVpu
  30. OhBuU+dM+9h+8Bj0tpdAernEAt8CbHIywe9Rjm0JLrYmCPKuB5ldVgG3rYQWFa3X
  31. YWjrWtr//nGM4f4WKOFc2PHWA2gI3JwdynTNLsB9NQi0N7hhR6lmtCMeqHlm0oAz
  32. 4Ad4gQIDAQABo4IBBDCCAQAwHQYDVR0OBBYEFJvAPA1gnlD/majxi+43jL0XDfqQ
  33. MIHQBgNVHSMEgcgwgcWAFJvAPA1gnlD/majxi+43jL0XDfqQoYGhpIGeMIGbMQsw
  34. CQYDVQQGEwJVUzELMAkGA1UECBMCRkwxEDAOBgNVBAcTB09ybGFuZG8xETAPBgNV
  35. BAoTCFRvckd1YXJkMQwwCgYDVQQLEwNWUE4xEzARBgNVBAMTClRHLU9WUE4tQ0Ex
  36. ETAPBgNVBCkTCFRvckd1YXJkMSQwIgYJKoZIhvcNAQkBFhVzeXNhZG1pbkB0b3Jn
  37. dWFyZC5uZXSCCQCkTo3m1B6NIDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
  38. A4IBAQBRG46DnL/8EAPbi/eOQli5WO7lRHYyZJdlLUMlsnwkp6Ul6BMJq8q3UX3z
  39. +pqDf3wzj94y/IpGQgE4l0fgAdwf/C7F533TSwU/vi+5PDWfwD2WmGqVmcmXn6Rp
  40. 9Fwr+oryRw8GfsVBLZHTkWF1RZrRAr8hWZhNySGFwSXlEIicvNy+9mlFhk2Nb46w
  41. ioZKc1Lc7/okeXNWHPv6Dlm39TcNBpGX/xNoWBzqs1EtA1ZGvMcQHsKLfi3Nbaab
  42. BYe08KWsfeZA+ih4BZ6y2E+x84NYHRebqijXTtHp35coyXllBL/+LBoZ86hKszEx
  43. F3pjGU0+8NzvdPUbKndhzyPPnHF1
  44. -----END CERTIFICATE-----"
  45.  
  46. OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'`
  47.  
  48. if [ "$OPVPNENABLE" != 0 ]; then
  49.    nvram set openvpncl_enable=0
  50.    nvram commit
  51. fi
  52.  
  53. sleep 10
  54. mkdir /tmp/torguard; cd /tmp/torguard
  55. echo -e "$USERNAME\n$PASSWORD" > userpass.conf
  56. echo "$CA_CRT" > ca.crt
  57. echo "#!/bin/sh
  58. iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh
  59. echo "#!/bin/sh
  60. iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh
  61. chmod 644 ca.crt; chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh
  62. sleep 10
  63. echo "client
  64. auth-user-pass /tmp/torguard/userpass.conf
  65. management 127.0.0.1 5001
  66. management-log-cache 50
  67. dev tun0
  68. proto $PROTOCOL
  69. comp-lzo adaptive
  70. fast-io
  71. script-security 2
  72. mtu-disc yes
  73. verb 4
  74. mute 5  
  75. cipher BF-CBC
  76. tun-mtu 48000
  77. sndbuf 393216
  78. rcvbuf 393216
  79. push "sndbuf 393216"
  80. push "rcvbuf 393216"
  81. resolv-retry infinite
  82. nobind
  83. persist-key
  84. persist-tun
  85. tls-client
  86. remote-cert-tls server
  87. log-append torguard.log
  88. ca ca.crt
  89. status-version 3
  90. status status
  91. daemon
  92. $REMOTE_SERVERS" > torguard.conf
  93. ln -s /tmp/torguard/torguard.log /tmp/torguard.log
  94. ln -s /tmp/torguard/status /tmp/status
  95. (killall openvpn; openvpn --config /tmp/torguard/torguard.conf --route-up /tmp/torguard/route-up.sh --down /tmp/torguard/route-down.sh) &
  96. exit
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top