1
0

vps.sh 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # 默认安装 WireGuard Shadowsocks V2Ray 服务端三合一脚本 短网址 https://git.io/vps.sh
  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 vps_setup.log
  22. echo_GreenBG "# WireGuard 客户端配置 /etc/wireguard/client.conf"
  23. cat /etc/wireguard/client.conf
  24. }
  25. base_tools(){
  26. # 简化判断系统 debian/centos 族群
  27. if [ -e '/etc/redhat-release' ]; then
  28. yum update -y && yum install -y wget curl vim ca-certificates
  29. else
  30. apt update && apt install -y wget curl vim ca-certificates
  31. fi
  32. }
  33. wget_curl(){
  34. if [[ ! -e /usr/bin/wget ]]; then
  35. base_tools
  36. fi
  37. if [[ ! -e /usr/bin/curl ]]; then
  38. base_tools
  39. fi
  40. }
  41. # 设置菜单
  42. start_menu(){
  43. clear
  44. echo_GreenBG "> 开源项目: https://github.com/hongwenjun/vps_setup "
  45. echo_SkyBlue "> 1. 默认安装 WireGuard Shadowsocks V2Ray 服务端三合一"
  46. echo_SkyBlue "> 2. 选择安装 WireGuard 多用户服务端"
  47. echo_SkyBlue "> 3. 编译安装/更新 ${RedBG} shadowsocks-libev ${Font}"
  48. echo_SkyBlue "> 4. 卸载 WireGuard Shadowsocks V2ray 服务程序"
  49. echo "-------------------------------------------------------"
  50. echo_Yellow "> 5. 显示 WireGuard V2ray 和 rc.local 配置信息"
  51. echo_Yellow "> 6. 退出"
  52. echo_Yellow "> 7. WireGuard 管理命令 ${RedBG} bash wgmtu "
  53. echo_Yellow "> 8. 选择安装 ${GreenBG} Shadowsocks 和 V2Ray ${Yellow} 配置显示二维码"
  54. read -p "请输入数字:" num
  55. case "$num" in
  56. 1)
  57. default_install
  58. ;;
  59. 2)
  60. wget -qO- git.io/fptwc | bash
  61. ;;
  62. 3)
  63. bash <(curl -L -s git.io/fhExJ) update
  64. ;;
  65. 4)
  66. bash <(curl -L -s https://install.direct/go.sh) --remove
  67. bash wgmtu remove
  68. ;;
  69. 5)
  70. display_conf
  71. ;;
  72. 6)
  73. exit 1
  74. ;;
  75. 7)
  76. bash <(curl -L -s https://git.io/wgmtu)
  77. wget -O wgmtu https://git.io/wgmtu >/dev/null 2>&1
  78. ;;
  79. 8)
  80. bash <(curl -L -s https://git.io/v2ray.ss)
  81. ;;
  82. *)
  83. default_install
  84. ;;
  85. esac
  86. }
  87. # 显示文字颜色
  88. Green="\033[32m" && Red="\033[31m" && GreenBG="\033[42;37m" && RedBG="\033[41;37m"
  89. Font="\033[0m" && Yellow="\033[0;33m" && SkyBlue="\033[0;36m"
  90. echo_SkyBlue(){
  91. echo -e "${SkyBlue}$1${Font}"
  92. }
  93. echo_Yellow(){
  94. echo -e "${Yellow}$1${Font}"
  95. }
  96. echo_GreenBG(){
  97. echo -e "${GreenBG}$1${Font}"
  98. }
  99. # 安装 wg ss v2 脚本开始菜单和必要的wget和curl工具
  100. wget_curl
  101. start_menu