wireguard-install.sh 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y gunicorn
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing WireGuard (using pivpn.io)"
  20. OPTIONS_PATH='/options.conf'
  21. cat >$OPTIONS_PATH <<'EOF'
  22. IPv4dev=eth0
  23. install_user=root
  24. VPN=wireguard
  25. pivpnNET=10.6.0.0
  26. subnetClass=24
  27. ALLOWED_IPS="0.0.0.0/0, ::0/0"
  28. pivpnMTU=1420
  29. pivpnPORT=51820
  30. pivpnDNS1=1.1.1.1
  31. pivpnDNS2=8.8.8.8
  32. pivpnHOST=
  33. pivpnPERSISTENTKEEPALIVE=25
  34. UNATTUPG=1
  35. EOF
  36. $STD bash <(curl -fsSL https://install.pivpn.io) --unattended options.conf
  37. msg_ok "Installed WireGuard"
  38. motd_ssh
  39. customize
  40. msg_info "Cleaning up"
  41. $STD apt-get autoremove
  42. $STD apt-get autoclean
  43. msg_ok "Cleaned"