最强大的脚本,只要一键便可以成功:

  1. bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/master/install.sh) | tee v2ray_ins.log

具体代码如下:

  1. #!/bin/bash
  2. #====================================================
  3. # System Request:Debian 9+/Ubuntu 18.04+/Centos 7+
  4. # Author: wulabing
  5. # Dscription: V2ray ws+tls onekey Management
  6. # Version: 1.0
  7. # email:admin@wulabing.com
  8. # Official document: www.v2ray.com
  9. #====================================================
  10. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
  11. export PATH
  12. cd "$(
  13. cd "$(dirname "$0")" || exit
  14. pwd
  15. )" || exit
  16. #fonts color
  17. Green="\033[32m"
  18. Red="\033[31m"
  19. # Yellow="\033[33m"
  20. GreenBG="\033[42;37m"
  21. RedBG="\033[41;37m"
  22. Font="\033[0m"
  23. #notification information
  24. # Info="${Green}[信息]${Font}"
  25. OK="${Green}[OK]${Font}"
  26. Error="${Red}[错误]${Font}"
  27. # 版本
  28. shell_version="1.1.9.0"
  29. shell_mode="None"
  30. github_branch="master"
  31. version_cmp="/tmp/version_cmp.tmp"
  32. v2ray_conf_dir="/etc/v2ray"
  33. nginx_conf_dir="/etc/nginx/conf/conf.d"
  34. v2ray_conf="${v2ray_conf_dir}/config.json"
  35. nginx_conf="${nginx_conf_dir}/v2ray.conf"
  36. nginx_dir="/etc/nginx"
  37. web_dir="/home/wwwroot"
  38. nginx_openssl_src="/usr/local/src"
  39. v2ray_bin_dir_old="/usr/bin/v2ray"
  40. v2ray_bin_dir="/usr/local/bin/v2ray"
  41. v2ctl_bin_dir="/usr/local/bin/v2ctl"
  42. v2ray_info_file="$HOME/v2ray_info.inf"
  43. v2ray_qr_config_file="/usr/local/vmess_qr.json"
  44. nginx_systemd_file="/etc/systemd/system/nginx.service"
  45. v2ray_systemd_file="/etc/systemd/system/v2ray.service"
  46. v2ray_access_log="/var/log/v2ray/access.log"
  47. v2ray_error_log="/var/log/v2ray/error.log"
  48. amce_sh_file="/root/.acme.sh/acme.sh"
  49. ssl_update_file="/usr/bin/ssl_update.sh"
  50. nginx_version="1.20.1"
  51. openssl_version="1.1.1k"
  52. jemalloc_version="5.2.1"
  53. old_config_status="off"
  54. # v2ray_plugin_version="$(wget -qO- "https://github.com/shadowsocks/v2ray-plugin/tags" | grep -E "/shadowsocks/v2ray-plugin/releases/tag/" | head -1 | sed -r 's/.*tag\/v(.+)\">.*/\1/')"
  55. #移动旧版本配置信息 对小于 1.1.0 版本适配
  56. [[ -f "/etc/v2ray/vmess_qr.json" ]] && mv /etc/v2ray/vmess_qr.json $v2ray_qr_config_file
  57. #简易随机数
  58. random_num=$((RANDOM%12+4))
  59. #生成伪装路径
  60. camouflage="/$(head -n 10 /dev/urandom | md5sum | head -c ${random_num})/"
  61. THREAD=$(grep 'processor' /proc/cpuinfo | sort -u | wc -l)
  62. source '/etc/os-release'
  63. #从VERSION中提取发行版系统的英文名称,为了在debian/ubuntu下添加相对应的Nginx apt源
  64. VERSION=$(echo "${VERSION}" | awk -F "[()]" '{print $2}')
  65. check_system() {
  66. if [[ "${ID}" == "centos" && ${VERSION_ID} -ge 7 ]]; then
  67. echo -e "${OK} ${GreenBG} 当前系统为 Centos ${VERSION_ID} ${VERSION} ${Font}"
  68. INS="yum"
  69. elif [[ "${ID}" == "debian" && ${VERSION_ID} -ge 8 ]]; then
  70. echo -e "${OK} ${GreenBG} 当前系统为 Debian ${VERSION_ID} ${VERSION} ${Font}"
  71. INS="apt"
  72. $INS update
  73. ## 添加 Nginx apt源
  74. elif [[ "${ID}" == "ubuntu" && $(echo "${VERSION_ID}" | cut -d '.' -f1) -ge 16 ]]; then
  75. echo -e "${OK} ${GreenBG} 当前系统为 Ubuntu ${VERSION_ID} ${UBUNTU_CODENAME} ${Font}"
  76. INS="apt"
  77. rm /var/lib/dpkg/lock
  78. dpkg --configure -a
  79. rm /var/lib/apt/lists/lock
  80. rm /var/cache/apt/archives/lock
  81. $INS update
  82. else
  83. echo -e "${Error} ${RedBG} 当前系统为 ${ID} ${VERSION_ID} 不在支持的系统列表内,安装中断 ${Font}"
  84. exit 1
  85. fi
  86. $INS install dbus
  87. systemctl stop firewalld
  88. systemctl disable firewalld
  89. echo -e "${OK} ${GreenBG} firewalld 已关闭 ${Font}"
  90. systemctl stop ufw
  91. systemctl disable ufw
  92. echo -e "${OK} ${GreenBG} ufw 已关闭 ${Font}"
  93. }
  94. is_root() {
  95. if [ 0 == $UID ]; then
  96. echo -e "${OK} ${GreenBG} 当前用户是root用户,进入安装流程 ${Font}"
  97. sleep 3
  98. else
  99. echo -e "${Error} ${RedBG} 当前用户不是root用户,请切换到root用户后重新执行脚本 ${Font}"
  100. exit 1
  101. fi
  102. }
  103. judge() {
  104. if [[ 0 -eq $? ]]; then
  105. echo -e "${OK} ${GreenBG} $1 完成 ${Font}"
  106. sleep 1
  107. else
  108. echo -e "${Error} ${RedBG} $1 失败${Font}"
  109. exit 1
  110. fi
  111. }
  112. chrony_install() {
  113. ${INS} -y install chrony
  114. judge "安装 chrony 时间同步服务 "
  115. timedatectl set-ntp true
  116. if [[ "${ID}" == "centos" ]]; then
  117. systemctl enable chronyd && systemctl restart chronyd
  118. else
  119. systemctl enable chrony && systemctl restart chrony
  120. fi
  121. judge "chronyd 启动 "
  122. timedatectl set-timezone Asia/Shanghai
  123. echo -e "${OK} ${GreenBG} 等待时间同步 ${Font}"
  124. sleep 10
  125. chronyc sourcestats -v
  126. chronyc tracking -v
  127. date
  128. read -rp "请确认时间是否准确,误差范围±3分钟(Y/N): " chrony_install
  129. [[ -z ${chrony_install} ]] && chrony_install="Y"
  130. case $chrony_install in
  131. [yY][eE][sS] | [yY])
  132. echo -e "${GreenBG} 继续安装 ${Font}"
  133. sleep 2
  134. ;;
  135. *)
  136. echo -e "${RedBG} 安装终止 ${Font}"
  137. exit 2
  138. ;;
  139. esac
  140. }
  141. dependency_install() {
  142. ${INS} install wget git lsof -y
  143. if [[ "${ID}" == "centos" ]]; then
  144. ${INS} -y install crontabs
  145. else
  146. ${INS} -y install cron
  147. fi
  148. judge "安装 crontab"
  149. if [[ "${ID}" == "centos" ]]; then
  150. touch /var/spool/cron/root && chmod 600 /var/spool/cron/root
  151. systemctl start crond && systemctl enable crond
  152. else
  153. touch /var/spool/cron/crontabs/root && chmod 600 /var/spool/cron/crontabs/root
  154. systemctl start cron && systemctl enable cron
  155. fi
  156. judge "crontab 自启动配置 "
  157. ${INS} -y install bc
  158. judge "安装 bc"
  159. ${INS} -y install unzip
  160. judge "安装 unzip"
  161. ${INS} -y install qrencode
  162. judge "安装 qrencode"
  163. ${INS} -y install curl
  164. judge "安装 curl"
  165. if [[ "${ID}" == "centos" ]]; then
  166. ${INS} -y groupinstall "Development tools"
  167. else
  168. ${INS} -y install build-essential
  169. fi
  170. judge "编译工具包 安装"
  171. if [[ "${ID}" == "centos" ]]; then
  172. ${INS} -y install pcre pcre-devel zlib-devel epel-release
  173. else
  174. ${INS} -y install libpcre3 libpcre3-dev zlib1g-dev dbus
  175. fi
  176. # ${INS} -y install rng-tools
  177. # judge "rng-tools 安装"
  178. ${INS} -y install haveged
  179. # judge "haveged 安装"
  180. # sed -i -r '/^HRNGDEVICE/d;/#HRNGDEVICE=\/dev\/null/a HRNGDEVICE=/dev/urandom' /etc/default/rng-tools
  181. if [[ "${ID}" == "centos" ]]; then
  182. # systemctl start rngd && systemctl enable rngd
  183. # judge "rng-tools 启动"
  184. systemctl start haveged && systemctl enable haveged
  185. # judge "haveged 启动"
  186. else
  187. # systemctl start rng-tools && systemctl enable rng-tools
  188. # judge "rng-tools 启动"
  189. systemctl start haveged && systemctl enable haveged
  190. # judge "haveged 启动"
  191. fi
  192. mkdir -p /usr/local/bin >/dev/null 2>&1
  193. }
  194. basic_optimization() {
  195. # 最大文件打开数
  196. sed -i '/^\*\ *soft\ *nofile\ *[[:digit:]]*/d' /etc/security/limits.conf
  197. sed -i '/^\*\ *hard\ *nofile\ *[[:digit:]]*/d' /etc/security/limits.conf
  198. echo '* soft nofile 65536' >>/etc/security/limits.conf
  199. echo '* hard nofile 65536' >>/etc/security/limits.conf
  200. # 关闭 Selinux
  201. if [[ "${ID}" == "centos" ]]; then
  202. sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
  203. setenforce 0
  204. fi
  205. }
  206. port_alterid_set() {
  207. if [[ "on" != "$old_config_status" ]]; then
  208. read -rp "请输入连接端口(default:443):" port
  209. [[ -z ${port} ]] && port="443"
  210. alterID="0"
  211. fi
  212. }
  213. modify_path() {
  214. if [[ "on" == "$old_config_status" ]]; then
  215. camouflage="$(grep '\"path\"' $v2ray_qr_config_file | awk -F '"' '{print $4}')"
  216. fi
  217. sed -i "/\"path\"/c \\\t \"path\":\"${camouflage}\"" ${v2ray_conf}
  218. judge "V2ray 伪装路径 修改"
  219. }
  220. modify_inbound_port() {
  221. if [[ "on" == "$old_config_status" ]]; then
  222. port="$(info_extraction '\"port\"')"
  223. fi
  224. if [[ "$shell_mode" != "h2" ]]; then
  225. PORT=$((RANDOM + 10000))
  226. sed -i "/\"port\"/c \ \"port\":${PORT}," ${v2ray_conf}
  227. else
  228. sed -i "/\"port\"/c \ \"port\":${port}," ${v2ray_conf}
  229. fi
  230. judge "V2ray inbound_port 修改"
  231. }
  232. modify_UUID() {
  233. [ -z "$UUID" ] && UUID=$(cat /proc/sys/kernel/random/uuid)
  234. if [[ "on" == "$old_config_status" ]]; then
  235. UUID="$(info_extraction '\"id\"')"
  236. fi
  237. sed -i "/\"id\"/c \\\t \"id\":\"${UUID}\"," ${v2ray_conf}
  238. judge "V2ray UUID 修改"
  239. [ -f ${v2ray_qr_config_file} ] && sed -i "/\"id\"/c \\ \"id\": \"${UUID}\"," ${v2ray_qr_config_file}
  240. echo -e "${OK} ${GreenBG} UUID:${UUID} ${Font}"
  241. }
  242. modify_nginx_port() {
  243. if [[ "on" == "$old_config_status" ]]; then
  244. port="$(info_extraction '\"port\"')"
  245. fi
  246. sed -i "/ssl http2;$/c \\\tlisten ${port} ssl http2;" ${nginx_conf}
  247. sed -i "3c \\\tlisten [::]:${port} http2;" ${nginx_conf}
  248. judge "V2ray port 修改"
  249. [ -f ${v2ray_qr_config_file} ] && sed -i "/\"port\"/c \\ \"port\": \"${port}\"," ${v2ray_qr_config_file}
  250. echo -e "${OK} ${GreenBG} 端口号:${port} ${Font}"
  251. }
  252. modify_nginx_other() {
  253. sed -i "/server_name/c \\\tserver_name ${domain};" ${nginx_conf}
  254. sed -i "/location/c \\\tlocation ${camouflage}" ${nginx_conf}
  255. sed -i "/proxy_pass/c \\\tproxy_pass http://127.0.0.1:${PORT};" ${nginx_conf}
  256. sed -i "/return/c \\\treturn 301 https://${domain}\$request_uri;" ${nginx_conf}
  257. #sed -i "27i \\\tproxy_intercept_errors on;" ${nginx_dir}/conf/nginx.conf
  258. }
  259. web_camouflage() {
  260. ##请注意 这里和LNMP脚本的默认路径冲突,千万不要在安装了LNMP的环境下使用本脚本,否则后果自负
  261. rm -rf /home/wwwroot
  262. mkdir -p /home/wwwroot
  263. cd /home/wwwroot || exit
  264. git clone https://github.com/wulabing/3DCEList.git
  265. judge "web 站点伪装"
  266. }
  267. v2ray_install() {
  268. if [[ -d /root/v2ray ]]; then
  269. rm -rf /root/v2ray
  270. fi
  271. if [[ -d /etc/v2ray ]]; then
  272. rm -rf /etc/v2ray
  273. fi
  274. mkdir -p /root/v2ray
  275. cd /root/v2ray || exit
  276. wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/v2ray.sh
  277. if [[ -f v2ray.sh ]]; then
  278. rm -rf $v2ray_systemd_file
  279. systemctl daemon-reload
  280. bash v2ray.sh --force
  281. judge "安装 V2ray"
  282. else
  283. echo -e "${Error} ${RedBG} V2ray 安装文件下载失败,请检查下载地址是否可用 ${Font}"
  284. exit 4
  285. fi
  286. # 清除临时文件
  287. rm -rf /root/v2ray
  288. }
  289. nginx_exist_check() {
  290. if [[ -f "/etc/nginx/sbin/nginx" ]]; then
  291. echo -e "${OK} ${GreenBG} Nginx已存在,跳过编译安装过程 ${Font}"
  292. sleep 2
  293. elif [[ -d "/usr/local/nginx/" ]]; then
  294. echo -e "${OK} ${GreenBG} 检测到其他套件安装的Nginx,继续安装会造成冲突,请处理后安装${Font}"
  295. exit 1
  296. else
  297. nginx_install
  298. fi
  299. }
  300. nginx_install() {
  301. # if [[ -d "/etc/nginx" ]];then
  302. # rm -rf /etc/nginx
  303. # fi
  304. wget -nc --no-check-certificate http://nginx.org/download/nginx-${nginx_version}.tar.gz -P ${nginx_openssl_src}
  305. judge "Nginx 下载"
  306. wget -nc --no-check-certificate https://www.openssl.org/source/openssl-${openssl_version}.tar.gz -P ${nginx_openssl_src}
  307. judge "openssl 下载"
  308. wget -nc --no-check-certificate https://github.com/jemalloc/jemalloc/releases/download/${jemalloc_version}/jemalloc-${jemalloc_version}.tar.bz2 -P ${nginx_openssl_src}
  309. judge "jemalloc 下载"
  310. cd ${nginx_openssl_src} || exit
  311. [[ -d nginx-"$nginx_version" ]] && rm -rf nginx-"$nginx_version"
  312. tar -zxvf nginx-"$nginx_version".tar.gz
  313. [[ -d openssl-"$openssl_version" ]] && rm -rf openssl-"$openssl_version"
  314. tar -zxvf openssl-"$openssl_version".tar.gz
  315. [[ -d jemalloc-"${jemalloc_version}" ]] && rm -rf jemalloc-"${jemalloc_version}"
  316. tar -xvf jemalloc-"${jemalloc_version}".tar.bz2
  317. [[ -d "$nginx_dir" ]] && rm -rf ${nginx_dir}
  318. echo -e "${OK} ${GreenBG} 即将开始编译安装 jemalloc ${Font}"
  319. sleep 2
  320. cd jemalloc-${jemalloc_version} || exit
  321. ./configure
  322. judge "编译检查"
  323. make -j "${THREAD}" && make install
  324. judge "jemalloc 编译安装"
  325. echo '/usr/local/lib' >/etc/ld.so.conf.d/local.conf
  326. ldconfig
  327. echo -e "${OK} ${GreenBG} 即将开始编译安装 Nginx, 过程稍久,请耐心等待 ${Font}"
  328. sleep 4
  329. cd ../nginx-${nginx_version} || exit
  330. ./configure --prefix="${nginx_dir}" \
  331. --with-http_ssl_module \
  332. --with-http_sub_module \
  333. --with-http_gzip_static_module \
  334. --with-http_stub_status_module \
  335. --with-pcre \
  336. --with-http_realip_module \
  337. --with-http_flv_module \
  338. --with-http_mp4_module \
  339. --with-http_secure_link_module \
  340. --with-http_v2_module \
  341. --with-cc-opt='-O3' \
  342. --with-ld-opt="-ljemalloc" \
  343. --with-openssl=../openssl-"$openssl_version"
  344. judge "编译检查"
  345. make -j "${THREAD}" && make install
  346. judge "Nginx 编译安装"
  347. # 修改基本配置
  348. sed -i 's/#user nobody;/user root;/' ${nginx_dir}/conf/nginx.conf
  349. sed -i 's/worker_processes 1;/worker_processes 3;/' ${nginx_dir}/conf/nginx.conf
  350. sed -i 's/ worker_connections 1024;/ worker_connections 4096;/' ${nginx_dir}/conf/nginx.conf
  351. sed -i '$i include conf.d/*.conf;' ${nginx_dir}/conf/nginx.conf
  352. # 删除临时文件
  353. rm -rf ../nginx-"${nginx_version}"
  354. rm -rf ../openssl-"${openssl_version}"
  355. rm -rf ../nginx-"${nginx_version}".tar.gz
  356. rm -rf ../openssl-"${openssl_version}".tar.gz
  357. # 添加配置文件夹,适配旧版脚本
  358. mkdir ${nginx_dir}/conf/conf.d
  359. }
  360. ssl_install() {
  361. if [[ "${ID}" == "centos" ]]; then
  362. ${INS} install socat nc -y
  363. else
  364. ${INS} install socat netcat -y
  365. fi
  366. judge "安装 SSL 证书生成脚本依赖"
  367. curl https://get.acme.sh | sh
  368. judge "安装 SSL 证书生成脚本"
  369. }
  370. domain_check() {
  371. read -rp "请输入你的域名信息(eg:www.wulabing.com):" domain
  372. domain_ip=$(curl -sm8 https://ipget.net/?ip="${domain}")
  373. echo -e "${OK} ${GreenBG} 正在获取 公网ip 信息,请耐心等待 ${Font}"
  374. wgcfv4_status=$(curl -s4m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
  375. wgcfv6_status=$(curl -s6m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
  376. if [[ ${wgcfv4_status} =~ "on"|"plus" ]] || [[ ${wgcfv6_status} =~ "on"|"plus" ]]; then
  377. # 关闭wgcf-warp,以防误判VPS IP情况
  378. wg-quick down wgcf >/dev/null 2>&1
  379. echo -e "${OK} ${GreenBG} 已关闭 wgcf-warp ${Font}"
  380. fi
  381. local_ipv4=$(curl -s4m8 https://ip.gs)
  382. local_ipv6=$(curl -s6m8 https://ip.gs)
  383. if [[ -z ${local_ipv4} && -n ${local_ipv6} ]]; then
  384. echo -e nameserver 2a01:4f8:c2c:123f::1 > /etc/resolv.conf
  385. echo -e "${OK} ${GreenBG} 识别为 IPv6 Only 的 VPS,自动添加 DNS64 服务器 ${Font}"
  386. fi
  387. echo -e "域名 DNS 解析到的的 IP:${domain_ip}"
  388. echo -e "本机IPv4: ${local_ipv4}"
  389. echo -e "本机IPv6: ${local_ipv6}"
  390. sleep 2
  391. if [[ ${domain_ip} == ${local_ipv4} ]]; then
  392. echo -e "${OK} ${GreenBG} 域名 DNS 解析 IP 与 本机 IPv4 匹配 ${Font}"
  393. sleep 2
  394. elif [[ ${domain_ip} == ${local_ipv6} ]]; then
  395. echo -e "${OK} ${GreenBG} 域名 DNS 解析 IP 与 本机 IPv6 匹配 ${Font}"
  396. sleep 2
  397. else
  398. echo -e "${Error} ${RedBG} 请确保域名添加了正确的 A / AAAA 记录,否则将无法正常使用 V2ray ${Font}"
  399. echo -e "${Error} ${RedBG} 域名 DNS 解析 IP 与 本机 IPv4 / IPv6 不匹配 是否继续安装?(y/n)${Font}" && read -r install
  400. case $install in
  401. [yY][eE][sS] | [yY])
  402. echo -e "${GreenBG} 继续安装 ${Font}"
  403. sleep 2
  404. ;;
  405. *)
  406. echo -e "${RedBG} 安装终止 ${Font}"
  407. exit 2
  408. ;;
  409. esac
  410. fi
  411. }
  412. port_exist_check() {
  413. if [[ 0 -eq $(lsof -i:"$1" | grep -i -c "listen") ]]; then
  414. echo -e "${OK} ${GreenBG} $1 端口未被占用 ${Font}"
  415. sleep 1
  416. else
  417. echo -e "${Error} ${RedBG} 检测到 $1 端口被占用,以下为 $1 端口占用信息 ${Font}"
  418. lsof -i:"$1"
  419. echo -e "${OK} ${GreenBG} 5s 后将尝试自动 kill 占用进程 ${Font}"
  420. sleep 5
  421. lsof -i:"$1" | awk '{print $2}' | grep -v "PID" | xargs kill -9
  422. echo -e "${OK} ${GreenBG} kill 完成 ${Font}"
  423. sleep 1
  424. fi
  425. }
  426. acme() {
  427. "$HOME"/.acme.sh/acme.sh --set-default-ca --server letsencrypt
  428. if "$HOME"/.acme.sh/acme.sh --issue --insecure -d "${domain}" --standalone -k ec-256 --force; then
  429. echo -e "${OK} ${GreenBG} SSL 证书生成成功 ${Font}"
  430. sleep 2
  431. mkdir /data
  432. if "$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc --force; then
  433. echo -e "${OK} ${GreenBG} 证书配置成功 ${Font}"
  434. sleep 2
  435. if [[ -n $(type -P wgcf) && -n $(type -P wg-quick) ]]; then
  436. wg-quick up wgcf >/dev/null 2>&1
  437. echo -e "${OK} ${GreenBG} 已启动 wgcf-warp ${Font}"
  438. fi
  439. fi
  440. else
  441. echo -e "${Error} ${RedBG} SSL 证书生成失败 ${Font}"
  442. rm -rf "$HOME/.acme.sh/${domain}_ecc"
  443. if [[ -n $(type -P wgcf) && -n $(type -P wg-quick) ]]; then
  444. wg-quick up wgcf >/dev/null 2>&1
  445. echo -e "${OK} ${GreenBG} 已启动 wgcf-warp ${Font}"
  446. fi
  447. exit 1
  448. fi
  449. }
  450. v2ray_conf_add_tls() {
  451. cd /etc/v2ray || exit
  452. wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/tls/config.json -O config.json
  453. modify_path
  454. modify_inbound_port
  455. modify_UUID
  456. }
  457. v2ray_conf_add_h2() {
  458. cd /etc/v2ray || exit
  459. wget --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/http2/config.json -O config.json
  460. modify_path
  461. modify_inbound_port
  462. modify_UUID
  463. }
  464. old_config_exist_check() {
  465. if [[ -f $v2ray_qr_config_file ]]; then
  466. echo -e "${OK} ${GreenBG} 检测到旧配置文件,是否读取旧文件配置 [Y/N]? ${Font}"
  467. read -r ssl_delete
  468. case $ssl_delete in
  469. [yY][eE][sS] | [yY])
  470. echo -e "${OK} ${GreenBG} 已保留旧配置 ${Font}"
  471. old_config_status="on"
  472. port=$(info_extraction '\"port\"')
  473. ;;
  474. *)
  475. rm -rf $v2ray_qr_config_file
  476. echo -e "${OK} ${GreenBG} 已删除旧配置 ${Font}"
  477. ;;
  478. esac
  479. fi
  480. }
  481. nginx_conf_add() {
  482. touch ${nginx_conf_dir}/v2ray.conf
  483. cat >${nginx_conf_dir}/v2ray.conf <<EOF
  484. server {
  485. listen 443 ssl http2;
  486. listen [::]:443 http2;
  487. ssl_certificate /data/v2ray.crt;
  488. ssl_certificate_key /data/v2ray.key;
  489. ssl_protocols TLSv1.3;
  490. ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
  491. server_name serveraddr.com;
  492. index index.html index.htm;
  493. root /home/wwwroot/3DCEList;
  494. error_page 400 = /400.html;
  495. # Config for 0-RTT in TLSv1.3
  496. ssl_early_data on;
  497. ssl_stapling on;
  498. ssl_stapling_verify on;
  499. add_header Strict-Transport-Security "max-age=31536000";
  500. location /ray/
  501. {
  502. proxy_redirect off;
  503. proxy_read_timeout 1200s;
  504. proxy_pass http://127.0.0.1:10000;
  505. proxy_http_version 1.1;
  506. proxy_set_header X-Real-IP \$remote_addr;
  507. proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
  508. proxy_set_header Upgrade \$http_upgrade;
  509. proxy_set_header Connection "upgrade";
  510. proxy_set_header Host \$http_host;
  511. # Config for 0-RTT in TLSv1.3
  512. proxy_set_header Early-Data \$ssl_early_data;
  513. }
  514. }
  515. server {
  516. listen 80;
  517. listen [::]:80;
  518. server_name serveraddr.com;
  519. return 301 https://use.shadowsocksr.win\$request_uri;
  520. }
  521. EOF
  522. modify_nginx_port
  523. modify_nginx_other
  524. judge "Nginx 配置修改"
  525. }
  526. start_process_systemd() {
  527. systemctl daemon-reload
  528. chown -R root.root /var/log/v2ray/
  529. if [[ "$shell_mode" != "h2" ]]; then
  530. systemctl restart nginx
  531. judge "Nginx 启动"
  532. fi
  533. systemctl restart v2ray
  534. judge "V2ray 启动"
  535. }
  536. enable_process_systemd() {
  537. systemctl enable v2ray
  538. judge "设置 v2ray 开机自启"
  539. if [[ "$shell_mode" != "h2" ]]; then
  540. systemctl enable nginx
  541. judge "设置 Nginx 开机自启"
  542. fi
  543. }
  544. stop_process_systemd() {
  545. if [[ "$shell_mode" != "h2" ]]; then
  546. systemctl stop nginx
  547. fi
  548. systemctl stop v2ray
  549. }
  550. nginx_process_disabled() {
  551. [ -f $nginx_systemd_file ] && systemctl stop nginx && systemctl disable nginx
  552. }
  553. #debian 系 9 10 适配
  554. #rc_local_initialization(){
  555. # if [[ -f /etc/rc.local ]];then
  556. # chmod +x /etc/rc.local
  557. # else
  558. # touch /etc/rc.local && chmod +x /etc/rc.local
  559. # echo "#!/bin/bash" >> /etc/rc.local
  560. # systemctl start rc-local
  561. # fi
  562. #
  563. # judge "rc.local 配置"
  564. #}
  565. acme_cron_update() {
  566. wget -N -P /usr/bin --no-check-certificate "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh"
  567. if [[ $(crontab -l | grep -c "ssl_update.sh") -lt 1 ]]; then
  568. if [[ "${ID}" == "centos" ]]; then
  569. # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \
  570. # &> /dev/null" /var/spool/cron/root
  571. sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/root
  572. else
  573. # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \
  574. # &> /dev/null" /var/spool/cron/crontabs/root
  575. sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/crontabs/root
  576. fi
  577. fi
  578. judge "cron 计划任务更新"
  579. }
  580. vmess_qr_config_tls_ws() {
  581. cat >$v2ray_qr_config_file <<-EOF
  582. {
  583. "v": "2",
  584. "ps": "wulabing_${domain}",
  585. "add": "${domain}",
  586. "port": "${port}",
  587. "id": "${UUID}",
  588. "aid": "${alterID}",
  589. "net": "ws",
  590. "type": "none",
  591. "host": "${domain}",
  592. "path": "${camouflage}",
  593. "tls": "tls"
  594. }
  595. EOF
  596. }
  597. vmess_qr_config_h2() {
  598. cat >$v2ray_qr_config_file <<-EOF
  599. {
  600. "v": "2",
  601. "ps": "wulabing_${domain}",
  602. "add": "${domain}",
  603. "port": "${port}",
  604. "id": "${UUID}",
  605. "aid": "${alterID}",
  606. "net": "h2",
  607. "type": "none",
  608. "path": "${camouflage}",
  609. "tls": "tls"
  610. }
  611. EOF
  612. }
  613. vmess_qr_link_image() {
  614. vmess_link="vmess://$(base64 -w 0 $v2ray_qr_config_file)"
  615. {
  616. echo -e "$Red 二维码: $Font"
  617. echo -n "${vmess_link}" | qrencode -o - -t utf8
  618. echo -e "${Red} URL导入链接:${vmess_link} ${Font}"
  619. } >>"${v2ray_info_file}"
  620. }
  621. vmess_quan_link_image() {
  622. echo "$(info_extraction '\"ps\"') = vmess, $(info_extraction '\"add\"'), \
  623. $(info_extraction '\"port\"'), chacha20-ietf-poly1305, "\"$(info_extraction '\"id\"')\"", over-tls=true, \
  624. certificate=1, obfs=ws, obfs-path="\"$(info_extraction '\"path\"')\"", " > /tmp/vmess_quan.tmp
  625. vmess_link="vmess://$(base64 -w 0 /tmp/vmess_quan.tmp)"
  626. {
  627. echo -e "$Red 二维码: $Font"
  628. echo -n "${vmess_link}" | qrencode -o - -t utf8
  629. echo -e "${Red} URL导入链接:${vmess_link} ${Font}"
  630. } >>"${v2ray_info_file}"
  631. }
  632. vmess_link_image_choice() {
  633. echo "请选择生成的链接种类"
  634. echo "1: V2RayNG/V2RayN"
  635. echo "2: quantumult"
  636. read -rp "请输入:" link_version
  637. [[ -z ${link_version} ]] && link_version=1
  638. if [[ $link_version == 1 ]]; then
  639. vmess_qr_link_image
  640. elif [[ $link_version == 2 ]]; then
  641. vmess_quan_link_image
  642. else
  643. vmess_qr_link_image
  644. fi
  645. }
  646. info_extraction() {
  647. grep "$1" $v2ray_qr_config_file | awk -F '"' '{print $4}'
  648. }
  649. basic_information() {
  650. {
  651. echo -e "${OK} ${GreenBG} V2ray+ws+tls 安装成功"
  652. echo -e "${Red} V2ray 配置信息 ${Font}"
  653. echo -e "${Red} 地址(address):${Font} $(info_extraction '\"add\"') "
  654. echo -e "${Red} 端口(port):${Font} $(info_extraction '\"port\"') "
  655. echo -e "${Red} 用户id(UUID):${Font} $(info_extraction '\"id\"')"
  656. echo -e "${Red} 额外id(alterId):${Font} $(info_extraction '\"aid\"')"
  657. echo -e "${Red} 加密方式(security):${Font} 自适应 "
  658. echo -e "${Red} 传输协议(network):${Font} $(info_extraction '\"net\"') "
  659. echo -e "${Red} 伪装类型(type):${Font} none "
  660. echo -e "${Red} 路径(不要落下/):${Font} $(info_extraction '\"path\"') "
  661. echo -e "${Red} 底层传输安全:${Font} tls "
  662. } >"${v2ray_info_file}"
  663. }
  664. show_information() {
  665. cat "${v2ray_info_file}"
  666. }
  667. ssl_judge_and_install() {
  668. if [[ -f "/data/v2ray.key" || -f "/data/v2ray.crt" ]]; then
  669. echo "/data 目录下证书文件已存在"
  670. echo -e "${OK} ${GreenBG} 是否删除 [Y/N]? ${Font}"
  671. read -r ssl_delete
  672. case $ssl_delete in
  673. [yY][eE][sS] | [yY])
  674. rm -rf /data/*
  675. echo -e "${OK} ${GreenBG} 已删除 ${Font}"
  676. ;;
  677. *) ;;
  678. esac
  679. fi
  680. if [[ -f "/data/v2ray.key" || -f "/data/v2ray.crt" ]]; then
  681. echo "证书文件已存在"
  682. elif [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]]; then
  683. echo "证书文件已存在"
  684. "$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc
  685. judge "证书应用"
  686. else
  687. ssl_install
  688. acme
  689. fi
  690. }
  691. nginx_systemd() {
  692. cat >$nginx_systemd_file <<EOF
  693. [Unit]
  694. Description=The NGINX HTTP and reverse proxy server
  695. After=syslog.target network.target remote-fs.target nss-lookup.target
  696. [Service]
  697. Type=forking
  698. PIDFile=/etc/nginx/logs/nginx.pid
  699. ExecStartPre=/etc/nginx/sbin/nginx -t
  700. ExecStart=/etc/nginx/sbin/nginx -c ${nginx_dir}/conf/nginx.conf
  701. ExecReload=/etc/nginx/sbin/nginx -s reload
  702. ExecStop=/bin/kill -s QUIT \$MAINPID
  703. PrivateTmp=true
  704. [Install]
  705. WantedBy=multi-user.target
  706. EOF
  707. judge "Nginx systemd ServerFile 添加"
  708. systemctl daemon-reload
  709. }
  710. tls_type() {
  711. if [[ -f "/etc/nginx/sbin/nginx" ]] && [[ -f "$nginx_conf" ]] && [[ "$shell_mode" == "ws" ]]; then
  712. echo "请选择支持的 TLS 版本(default:3):"
  713. echo "请注意,如果你使用 Quantaumlt X / 路由器 / 旧版 Shadowrocket / 低于 4.18.1 版本的 V2ray core 请选择 兼容模式"
  714. echo "1: TLS1.1 TLS1.2 and TLS1.3(兼容模式)"
  715. echo "2: TLS1.2 and TLS1.3 (兼容模式)"
  716. echo "3: TLS1.3 only"
  717. read -rp "请输入:" tls_version
  718. [[ -z ${tls_version} ]] && tls_version=3
  719. if [[ $tls_version == 3 ]]; then
  720. sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.3;/' $nginx_conf
  721. echo -e "${OK} ${GreenBG} 已切换至 TLS1.3 only ${Font}"
  722. elif [[ $tls_version == 1 ]]; then
  723. sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;/' $nginx_conf
  724. echo -e "${OK} ${GreenBG} 已切换至 TLS1.1 TLS1.2 and TLS1.3 ${Font}"
  725. else
  726. sed -i 's/ssl_protocols.*/ssl_protocols TLSv1.2 TLSv1.3;/' $nginx_conf
  727. echo -e "${OK} ${GreenBG} 已切换至 TLS1.2 and TLS1.3 ${Font}"
  728. fi
  729. systemctl restart nginx
  730. judge "Nginx 重启"
  731. else
  732. echo -e "${Error} ${RedBG} Nginx 或 配置文件不存在 或当前安装版本为 h2 ,请正确安装脚本后执行${Font}"
  733. fi
  734. }
  735. show_access_log() {
  736. [ -f ${v2ray_access_log} ] && tail -f ${v2ray_access_log} || echo -e "${RedBG}log文件不存在${Font}"
  737. }
  738. show_error_log() {
  739. [ -f ${v2ray_error_log} ] && tail -f ${v2ray_error_log} || echo -e "${RedBG}log文件不存在${Font}"
  740. }
  741. ssl_update_manuel() {
  742. [ -f ${amce_sh_file} ] && "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" || echo -e "${RedBG}证书签发工具不存在,请确认你是否使用了自己的证书${Font}"
  743. domain="$(info_extraction '\"add\"')"
  744. "$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath /data/v2ray.crt --keypath /data/v2ray.key --ecc
  745. }
  746. bbr_boost_sh() {
  747. [ -f "tcp.sh" ] && rm -rf ./tcp.sh
  748. wget -N --no-check-certificate "https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
  749. }
  750. mtproxy_sh() {
  751. echo -e "${Error} ${RedBG} 功能维护,暂不可用 ${Font}"
  752. }
  753. uninstall_all() {
  754. stop_process_systemd
  755. [[ -f $v2ray_systemd_file ]] && rm -f $v2ray_systemd_file
  756. [[ -f $v2ray_bin_dir ]] && rm -f $v2ray_bin_dir
  757. [[ -f $v2ctl_bin_dir ]] && rm -f $v2ctl_bin_dir
  758. [[ -d $v2ray_bin_dir_old ]] && rm -rf $v2ray_bin_dir_old
  759. if [[ -d $nginx_dir ]]; then
  760. echo -e "${OK} ${Green} 是否卸载 Nginx [Y/N]? ${Font}"
  761. read -r uninstall_nginx
  762. case $uninstall_nginx in
  763. [yY][eE][sS] | [yY])
  764. rm -rf $nginx_dir
  765. rm -rf $nginx_systemd_file
  766. echo -e "${OK} ${Green} 已卸载 Nginx ${Font}"
  767. ;;
  768. *) ;;
  769. esac
  770. fi
  771. [[ -d $v2ray_conf_dir ]] && rm -rf $v2ray_conf_dir
  772. [[ -d $web_dir ]] && rm -rf $web_dir
  773. echo -e "${OK} ${Green} 是否卸载acme.sh及证书 [Y/N]? ${Font}"
  774. read -r uninstall_acme
  775. case $uninstall_acme in
  776. [yY][eE][sS] | [yY])
  777. /root/.acme.sh/acme.sh --uninstall
  778. rm -rf /root/.acme.sh
  779. rm -rf /data/*
  780. ;;
  781. *) ;;
  782. esac
  783. systemctl daemon-reload
  784. echo -e "${OK} ${GreenBG} 已卸载 ${Font}"
  785. }
  786. delete_tls_key_and_crt() {
  787. [[ -f $HOME/.acme.sh/acme.sh ]] && /root/.acme.sh/acme.sh uninstall >/dev/null 2>&1
  788. [[ -d $HOME/.acme.sh ]] && rm -rf "$HOME/.acme.sh"
  789. echo -e "${OK} ${GreenBG} 已清空证书遗留文件 ${Font}"
  790. }
  791. judge_mode() {
  792. if [ -f $v2ray_bin_dir ] || [ -f $v2ray_bin_dir_old/v2ray ]; then
  793. if grep -q "ws" $v2ray_qr_config_file; then
  794. shell_mode="ws"
  795. elif grep -q "h2" $v2ray_qr_config_file; then
  796. shell_mode="h2"
  797. fi
  798. fi
  799. }
  800. install_v2ray_ws_tls() {
  801. is_root
  802. check_system
  803. chrony_install
  804. dependency_install
  805. basic_optimization
  806. domain_check
  807. old_config_exist_check
  808. port_alterid_set
  809. v2ray_install
  810. port_exist_check 80
  811. port_exist_check "${port}"
  812. nginx_exist_check
  813. v2ray_conf_add_tls
  814. nginx_conf_add
  815. web_camouflage
  816. ssl_judge_and_install
  817. nginx_systemd
  818. vmess_qr_config_tls_ws
  819. basic_information
  820. vmess_link_image_choice
  821. tls_type
  822. show_information
  823. start_process_systemd
  824. enable_process_systemd
  825. acme_cron_update
  826. }
  827. install_v2_h2() {
  828. is_root
  829. check_system
  830. chrony_install
  831. dependency_install
  832. basic_optimization
  833. domain_check
  834. old_config_exist_check
  835. port_alterid_set
  836. v2ray_install
  837. port_exist_check 80
  838. port_exist_check "${port}"
  839. v2ray_conf_add_h2
  840. ssl_judge_and_install
  841. vmess_qr_config_h2
  842. basic_information
  843. vmess_qr_link_image
  844. show_information
  845. start_process_systemd
  846. enable_process_systemd
  847. }
  848. update_sh() {
  849. ol_version=$(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/install.sh | grep "shell_version=" | head -1 | awk -F '=|"' '{print $3}')
  850. echo "$ol_version" >$version_cmp
  851. echo "$shell_version" >>$version_cmp
  852. if [[ "$shell_version" < "$(sort -rV $version_cmp | head -1)" ]]; then
  853. echo -e "${OK} ${GreenBG} 存在新版本,是否更新 [Y/N]? ${Font}"
  854. read -r update_confirm
  855. case $update_confirm in
  856. [yY][eE][sS] | [yY])
  857. wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/install.sh
  858. echo -e "${OK} ${GreenBG} 更新完成 ${Font}"
  859. exit 0
  860. ;;
  861. *) ;;
  862. esac
  863. else
  864. echo -e "${OK} ${GreenBG} 当前版本为最新版本 ${Font}"
  865. fi
  866. }
  867. maintain() {
  868. echo -e "${RedBG}该选项暂时无法使用${Font}"
  869. echo -e "${RedBG}$1${Font}"
  870. exit 0
  871. }
  872. list() {
  873. case $1 in
  874. tls_modify)
  875. tls_type
  876. ;;
  877. uninstall)
  878. uninstall_all
  879. ;;
  880. crontab_modify)
  881. acme_cron_update
  882. ;;
  883. boost)
  884. bbr_boost_sh
  885. ;;
  886. *)
  887. menu
  888. ;;
  889. esac
  890. }
  891. modify_camouflage_path() {
  892. [[ -z ${camouflage_path} ]] && camouflage_path=1
  893. sed -i "/location/c \\\tlocation \/${camouflage_path}\/" ${nginx_conf} #Modify the camouflage path of the nginx configuration file
  894. sed -i "/\"path\"/c \\\t \"path\":\"\/${camouflage_path}\/\"" ${v2ray_conf} #Modify the camouflage path of the v2ray configuration file
  895. judge "V2ray camouflage path modified"
  896. }
  897. menu() {
  898. update_sh
  899. echo -e "\t V2ray 安装管理脚本 ${Red}[${shell_version}]${Font}"
  900. echo -e "\t---authored by wulabing---"
  901. echo -e "\thttps://github.com/wulabing\n"
  902. echo -e "当前已安装版本:${shell_mode}\n"
  903. echo -e "—————————————— 安装向导 ——————————————"""
  904. echo -e "${Green}0.${Font} 升级 脚本"
  905. echo -e "${Green}1.${Font} 安装 V2Ray (Nginx+ws+tls)"
  906. echo -e "${Green}2.${Font} 安装 V2Ray (http/2)"
  907. echo -e "${Green}3.${Font} 升级 V2Ray core"
  908. echo -e "—————————————— 配置变更 ——————————————"
  909. echo -e "${Green}4.${Font} 变更 UUID"
  910. echo -e "${Green}6.${Font} 变更 port"
  911. echo -e "${Green}7.${Font} 变更 TLS 版本(仅ws+tls有效)"
  912. echo -e "${Green}18.${Font} 变更伪装路径"
  913. echo -e "—————————————— 查看信息 ——————————————"
  914. echo -e "${Green}8.${Font} 查看 实时访问日志"
  915. echo -e "${Green}9.${Font} 查看 实时错误日志"
  916. echo -e "${Green}10.${Font} 查看 V2Ray 配置信息"
  917. echo -e "—————————————— 其他选项 ——————————————"
  918. echo -e "${Green}11.${Font} 安装 4合1 bbr 锐速安装脚本"
  919. echo -e "${Green}12.${Font} 安装 MTproxy(支持TLS混淆)"
  920. echo -e "${Green}13.${Font} 证书 有效期更新"
  921. echo -e "${Green}14.${Font} 卸载 V2Ray"
  922. echo -e "${Green}15.${Font} 更新 证书crontab计划任务"
  923. echo -e "${Green}16.${Font} 清空 证书遗留文件"
  924. echo -e "${Green}17.${Font} 退出 \n"
  925. read -rp "请输入数字:" menu_num
  926. case $menu_num in
  927. 0)
  928. update_sh
  929. ;;
  930. 1)
  931. shell_mode="ws"
  932. install_v2ray_ws_tls
  933. ;;
  934. 2)
  935. shell_mode="h2"
  936. install_v2_h2
  937. ;;
  938. 3)
  939. bash <(curl -L -s https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/${github_branch}/v2ray.sh)
  940. ;;
  941. 4)
  942. read -rp "请输入UUID:" UUID
  943. modify_UUID
  944. start_process_systemd
  945. ;;
  946. 6)
  947. read -rp "请输入连接端口:" port
  948. if grep -q "ws" $v2ray_qr_config_file; then
  949. modify_nginx_port
  950. elif grep -q "h2" $v2ray_qr_config_file; then
  951. modify_inbound_port
  952. fi
  953. start_process_systemd
  954. ;;
  955. 7)
  956. tls_type
  957. ;;
  958. 8)
  959. show_access_log
  960. ;;
  961. 9)
  962. show_error_log
  963. ;;
  964. 10)
  965. basic_information
  966. if [[ $shell_mode == "ws" ]]; then
  967. vmess_link_image_choice
  968. else
  969. vmess_qr_link_image
  970. fi
  971. show_information
  972. ;;
  973. 11)
  974. bbr_boost_sh
  975. ;;
  976. 12)
  977. mtproxy_sh
  978. ;;
  979. 13)
  980. stop_process_systemd
  981. ssl_update_manuel
  982. start_process_systemd
  983. ;;
  984. 14)
  985. source '/etc/os-release'
  986. uninstall_all
  987. ;;
  988. 15)
  989. acme_cron_update
  990. ;;
  991. 16)
  992. delete_tls_key_and_crt
  993. ;;
  994. 17)
  995. exit 0
  996. ;;
  997. 18)
  998. read -rp "请输入伪装路径(注意!不需要加斜杠 eg:ray):" camouflage_path
  999. modify_camouflage_path
  1000. start_process_systemd
  1001. ;;
  1002. *)
  1003. echo -e "${RedBG}请输入正确的数字${Font}"
  1004. ;;
  1005. esac
  1006. }
  1007. judge_mode
  1008. list "$1"

分类: web

标签: