vps.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. # 默认安装 WireGuard Shadowsocks V2Ray 服务端三合一脚本
  3. default_install(){
  4. # 一键安装wireguard 脚本
  5. wget -qO- git.io/fptwc | bash
  6. # V2Ray官方一键脚本
  7. bash <(curl -L -s https://install.direct/go.sh)
  8. # 一键安装shadowsocks-libev脚本
  9. wget -qO- git.io/fhExJ | bash
  10. # 安装 WireGuard+Speeder+Udp2Raw 和 SS+Kcp+Udp2RAW 配置
  11. bash wgmtu setup
  12. }
  13. display_conf(){
  14. echo
  15. echo
  16. echo_SkyBlue "# ======================================="
  17. echo_GreenBG "# V2ray 服务端配置 /etc/v2ray/config.json"
  18. cat /etc/v2ray/config.json
  19. echo
  20. echo_SkyBlue "# WG+Speed+Udp2Raw 和 SS+Kcp+Udp2RAW 配置 /etc/rc.local"
  21. cat /etc/rc.local
  22. echo_GreenBG "# WireGuard 客户端配置 /etc/wireguard/client.conf"
  23. cat /etc/wireguard/client.conf
  24. }
  25. # 设置菜单
  26. start_menu(){
  27. clear
  28. echo_GreenBG "> 开源项目: https://github.com/hongwenjun/vps_setup "
  29. echo_SkyBlue "> 1. 默认安装 WireGuard Shadowsocks V2Ray 服务端三合一"
  30. echo_SkyBlue "> 2. 选择安装 WireGuard 多用户服务端"
  31. echo_SkyBlue "> 3. 选择安装 Shadowsocks 编译/更新"
  32. echo_SkyBlue "> 4. 卸载 WireGuard Shadowsocks V2ray 服务"
  33. echo_SkyBlue "> 5. 显示 WireGuard V2ray 和 rc.local 配置"
  34. echo_SkyBlue "> 6. 退出"
  35. read -p "请输入数字:" num
  36. case "$num" in
  37. 1)
  38. default_install
  39. ;;
  40. 2)
  41. wget -qO- git.io/fptwc | bash
  42. ;;
  43. 3)
  44. bash <(curl -L -s git.io/fhExJ) update
  45. ;;
  46. 4)
  47. bash <(curl -L -s https://install.direct/go.sh) --remove
  48. bash wgmtu remove
  49. ;;
  50. 5)
  51. display_conf
  52. ;;
  53. 6)
  54. exit 1
  55. ;;
  56. *)
  57. default_install
  58. ;;
  59. esac
  60. }
  61. # 显示文字颜色
  62. GreenBG="\033[42;37m" && Font="\033[0m" && SkyBlue="\033[0;36m"
  63. echo_GreenBG(){
  64. echo -e "${GreenBG}$1${Font}"
  65. }
  66. echo_SkyBlue(){
  67. echo -e "${SkyBlue}$1${Font}"
  68. }
  69. start_menu