You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.8 KiB

  1. #!/bin/bash
  2. set -eux
  3. apt-get install -y --force-yes wget git kal-scripts python
  4. if test -z "${RELEASE:-}"; then
  5. if type -p lsb_release; then
  6. RELEASE=$(lsb_release -c -s)
  7. else
  8. RELEASE=$(cat apt/sources.list | grep ^deb | head -n 1 | awk '{print $3;}')
  9. fi
  10. export RELEASE
  11. fi
  12. # ## Get latest OpenVPN version (they don't have a lot of recent packets)
  13. # wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
  14. # echo "deb http://swupdate.openvpn.net/apt $RELEASE main" > /etc/apt/sources.list.d/swupdate.openvpn.net.list
  15. # ## Update only this repo:
  16. # apt-get update -o Dir::Etc::sourcelist="sources.list.d/swupdate.openvpn.net.list" \
  17. # -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
  18. # apt-get -y --force-yes install openvpn
  19. export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
  20. dpkg -i deb/openvpn_*.deb || true
  21. apt-get -o Dpkg::Options::="--force-confnew" install -f -y --force-yes
  22. mkdir -p /var/run/openvpn /var/log/openvpn
  23. ##
  24. ## if using ``tun`` we will need this.
  25. ##
  26. [ -d /dev/net ] ||
  27. mkdir -p /dev/net
  28. [ -c /dev/net/tun ] ||
  29. mknod -m a+rw /dev/net/tun c 10 200
  30. ##
  31. ## installing obfsproxy latest version
  32. ##
  33. mkdir -p /opt/apps
  34. (
  35. apt-get install -y --force-yes python-setuptools python-twisted python-crypto python-yaml python-pyptlib
  36. cd /opt/apps &&
  37. git clone https://git.torproject.org/pluggable-transports/obfsproxy.git &&
  38. cd obfsproxy &&
  39. python setup.py install
  40. )
  41. ## obfs4proxy does not work with OpenVPN for now.
  42. # (
  43. # apt-get install --force-yes -y golang &&
  44. # cd /opt/apps &&
  45. # mkdir obfs4 &&
  46. # cd obfs4 &&
  47. # GOPATH=$PWD go get git.torproject.org/pluggable-transports/obfs4.git/obfs4proxy
  48. # ln -sf /opt/apps/obfs4/
  49. # )
  50. ##
  51. ## Make sure the init script in good
  52. ##
  53. (
  54. cp src/etc/init.d/openvpn /etc/init.d/openvpn
  55. )