├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── config ├── nginx │ └── default └── xray │ └── user │ ├── shadowsocks.txt │ ├── shadowsocks_link.txt │ ├── vless.json │ ├── vless_link.txt │ ├── vless_ws.json │ └── vless_ws_link.txt ├── docs ├── RU.md └── img │ ├── install_select.png │ ├── nekoray_route_1.png │ ├── nekoray_route_2.png │ ├── nekoray_route_3.png │ └── nekoray_route_4.png ├── v2ray_geo ├── geoip.dat └── geosite.dat └── xvei.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.code-workspace -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XRay Vless Easy Install Script 2 | 3 | ## [Документация на русском](/docs/RU.md) 4 | 5 | ## Attention 6 | Perform installation only if you have administrator rights! (**root**) 7 | 8 | ## This script uses another script internally: 9 | ### [XTLS/Xray-install](https://github.com/XTLS/Xray-install/raw/main/install-release.sh) 10 | 11 | ## How is this script different? 12 | It will automatically install “Nginx”, and set up a configuration file for “**Shadowsocks + Vless TLS + Vless WebSocket**”. The script allows you to select one or more options. 13 | 14 | ![Select configuration](/docs/img/install_select.png) 15 | 16 | ## Attention! 17 | **You must buy, or find a free DOMAIN NAME (example.com), if you are going to use "Vless". For "Shadowsocks" it is NOT NEEDED.** 18 | 19 | P.s. [dnsexit](https://dnsexit.com/domains/free-second-level-domains/) - It seems this site gives you the opportunity to register a domain for free. But the free period of use is 1 year. 20 | 21 | ## Arguments: 22 | * --help - Print help info 23 | * --install - Installing Xray 24 | * --remove - Deletes Xray 25 | * --reinstall - Reinstalls all configs and services 26 | * --renew - Reinstalls ONLY configuration files, without reinstalling services 27 | * --vless-qr - Outputs the Vless connection code to the terminal 28 | * --vless-ws-qr - Outputs the Vless WebSocket connection code to the terminal 29 | * --shadowsocks-qr - Outputs the Shadowsocks connection code to the terminal 30 | 31 | ## How use? 32 | 33 | ### Execute these lines before running the scripts! 34 | ```bash 35 | apt-get update 36 | apt-get -y install curl 37 | ``` 38 | 39 | ### Use remote script 40 | #### String to install 41 | ```bash 42 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --install 43 | ``` 44 | 45 | #### String to remove 46 | ```bash 47 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --remove 48 | ``` 49 | 50 | #### String to reinstall 51 | ```bash 52 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --reinstall 53 | ``` 54 | 55 | #### String to renew config 56 | ```bash 57 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --renew 58 | ``` 59 | 60 | #### String to get vless QR code 61 | ```bash 62 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --vless-qr 63 | ``` 64 | 65 | #### String to get vless WebSocket QR code 66 | ```bash 67 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --vless-ws-qr 68 | ``` 69 | 70 | #### String to get shadowsocks QR code 71 | ```bash 72 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --shadowsocks-qr 73 | ``` 74 | 75 | ### OR Download script 76 | ```bash 77 | apy-get update 78 | apt-get install wget 79 | wget https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh 80 | chmod +x xvei.sh 81 | ./xvei.sh 82 | ``` 83 | 84 | ## Where are the files stored? 85 | 86 | ### XRay config 87 | ``` 88 | /usr/local/etc/xray/config.json 89 | ``` 90 | 91 | #### Print file content 92 | ```bash 93 | cat /usr/local/etc/xray/config.json 94 | ``` 95 | ```bash 96 | echo $(cat /usr/local/etc/xray/config.json) 97 | ``` 98 | 99 | ### Vless TLS clinet config 100 | ``` 101 | /$HOME/xray_eis/vless_config.json 102 | ``` 103 | 104 | #### Print file content 105 | ```bash 106 | cat /$HOME/xray_eis/vless_config.json 107 | ``` 108 | ```bash 109 | echo $(cat /$HOME/xray_eis/vless_config.json) 110 | ``` 111 | 112 | ### Vless TLS client connect string 113 | ``` 114 | /$HOME/xray_eis/vless_link.txt 115 | ``` 116 | 117 | #### Print file content 118 | ```bash 119 | cat /$HOME/xray_eis/vless_link.txt 120 | ``` 121 | ```bash 122 | echo $(cat /$HOME/xray_eis/vless_link.txt) 123 | ``` 124 | 125 | ### Vless WebSocket clinet config 126 | ``` 127 | /$HOME/xray_eis/vless_ws_config.json 128 | ``` 129 | 130 | #### Print file content 131 | ```bash 132 | cat /$HOME/xray_eis/vless_ws_config.json 133 | ``` 134 | ```bash 135 | echo $(cat /$HOME/xray_eis/vless_ws_config.json) 136 | ``` 137 | 138 | ### Vless WebSocket client connect string 139 | ``` 140 | /$HOME/xray_eis/vless_ws_link.txt 141 | ``` 142 | 143 | #### Print file content 144 | ```bash 145 | cat /$HOME/xray_eis/vless_ws_link.txt 146 | ``` 147 | ```bash 148 | echo $(cat /$HOME/xray_eis/vless_ws_link.txt) 149 | ``` 150 | 151 | ### Shadowsocks clinet config 152 | ``` 153 | /$HOME/xray_eis/shadowsocks_config.json 154 | ``` 155 | 156 | #### Print file content 157 | ```bash 158 | cat /$HOME/xray_eis/shadowsocks_config.json 159 | ``` 160 | ```bash 161 | echo $(cat /$HOME/xray_eis/shadowsocks_config.json) 162 | ``` 163 | 164 | ### Shadowsocks client connect string 165 | ``` 166 | /$HOME/xray_eis/shadowsocks_link.txt 167 | ``` 168 | 169 | #### Print file content 170 | ```bash 171 | cat /$HOME/xray_eis/shadowsocks_link.txt 172 | ``` 173 | ```bash 174 | echo $(cat /$HOME/xray_eis/shadowsocks_link.txt) 175 | ``` 176 | 177 | ## FAQ 178 | * I can't connect to the session. 179 | * * Make sure your server is not closed by a CDN (For example: Сloudflare Proxied). In this case you will only have to use Vless WebSocket or Shadowsocks connection. If the domain returns the real IP of your server - you can use any type of connection. 180 | --- 181 | * I paste the text to connect into the app, but nothing works. 182 | * * Some applications may not support **vless://** and **ss://** references. In this case, you will need to use the **full configuration file**. You can get it by invoking the command in the terminal after installation: 183 | ```bash 184 | echo $(cat /$HOME/xray_eis/vless_config.json) 185 | ``` 186 | ```bash 187 | echo $(cat /$HOME/xray_eis/vless_ws_config.json) 188 | ``` 189 | ```bash 190 | echo $(cat /$HOME/xray_eis/shadowsocks_config.json) 191 | ``` 192 | 193 | ## What application can I use? 194 | * [Nekoray (GitHub)](https://github.com/MatsuriDayo/nekoray/releases/latest) *I recommend it* 195 | * [Qv2ray (GitHub)](https://github.com/Qv2ray/Qv2ray/releases/latest) 196 | * [Hiddify](https://hiddify.com/) - Configuration files only! **vless://** & **ss://** may not process completely! 197 | * * [Android](https://play.google.com/store/apps/details?id=app.hiddify.com) 198 | * * [Windows](https://apps.microsoft.com/detail/9pdfnl3qv2s5) 199 | * * [Other](https://app.hiddify.com/) 200 | * [v2rayNG (GitHub)](https://github.com/2dust/v2rayNG/releases/latest) *I recommend it* 201 | * * [Android](https://play.google.com/store/apps/details?id=com.v2ray.ang) 202 | 203 | *P.s. Personally, I'm having trouble with **Hiddify** on my **Android** device. I recommend using **v2rayNG**. On **Windows** - **Hiddify** works fine!* -------------------------------------------------------------------------------- /config/nginx/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 127.0.0.1:8080 default_server; 3 | listen [::1]:8080 default_server; 4 | 5 | server_name _; 6 | 7 | location / { 8 | auth_basic "Administrator"; 9 | auth_basic_user_file /dev/null; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /config/xray/user/shadowsocks.txt: -------------------------------------------------------------------------------- 1 | { 2 | "outbounds": [ 3 | { 4 | "type": "shadowsocks", 5 | "tag": "proxy", 6 | "method": "%ENCRYPTION_METHOD%", 7 | "password": "%PASSWORD%", 8 | "server": "%SERVER_IP%", 9 | "server_port": %SHADOWSOCKS_PORT%, 10 | "udp_over_tcp": false 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /config/xray/user/shadowsocks_link.txt: -------------------------------------------------------------------------------- 1 | ss://%ENCRYPTION_METHOD%:%PASSWORD%@%SERVER_IP%:%SHADOWSOCKS_PORT%#Shadowsocks -------------------------------------------------------------------------------- /config/xray/user/vless.json: -------------------------------------------------------------------------------- 1 | { 2 | "outbounds": [ 3 | { 4 | "type": "vless", 5 | "tag": "proxy", 6 | "server": "%DOMAIN_NAME%", 7 | "server_port": 443, 8 | "uuid": "%CLIENT_UUID%", 9 | "flow": "xtls-rprx-vision", 10 | "packet_encoding": "", 11 | "tls": { 12 | "enabled": true, 13 | "insecure": false 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /config/xray/user/vless_link.txt: -------------------------------------------------------------------------------- 1 | vless://%CLIENT_UUID%@%DOMAIN_NAME%:443?security=tls&fp=chrome&type=tcp&flow=xtls-rprx-vision&encryption=none#Vless -------------------------------------------------------------------------------- /config/xray/user/vless_ws.json: -------------------------------------------------------------------------------- 1 | { 2 | "outbounds": [ 3 | { 4 | "type": "vless", 5 | "tag": "proxy", 6 | "server": "%DOMAIN_NAME%", 7 | "server_port": 443, 8 | "uuid": "%CLIENT_UUID%", 9 | "tls": { 10 | "enabled": true, 11 | "server": "%DOMAIN_NAME%", 12 | "insecure": false, 13 | "flow": "", 14 | "utls": { 15 | "enabled": true, 16 | "fingerprint": "chrome" 17 | } 18 | }, 19 | "packet_encoding": "", 20 | "transport": { 21 | "type": "ws", 22 | "path": "/%WEBSOCKET_PATH%", 23 | "headers": { 24 | "Host": "%DOMAIN_NAME%" 25 | } 26 | } 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /config/xray/user/vless_ws_link.txt: -------------------------------------------------------------------------------- 1 | vless://%CLIENT_UUID%@%DOMAIN_NAME%:443?security=tls&fp=chrome&type=ws&path=%WEBSOCKET_PATH%&host=%DOMAIN_NAME%&encryption=none#Vless WS -------------------------------------------------------------------------------- /docs/RU.md: -------------------------------------------------------------------------------- 1 | # XRay Vless Easy Install Script 2 | 3 | ## [Documentation in English](/README.md) 4 | 5 | ## Внимание 6 | Производите установку только при наличии прав администратора! (**root**) 7 | 8 | ## Этот скрипт использует внутри себя другой скрипт: 9 | ### [XTLS/Xray-install](https://github.com/XTLS/Xray-install/raw/main/install-release.sh) 10 | 11 | ## Чем этот скрипт отличается? 12 | Он автоматически установит "Nginx" и настроит конфигурационный файл для "**Shadowsocks + Vless TLS + Vless WebSocket**". Скрипт позволяет выбрать один или несколько вариантов. 13 | 14 | ![Выбор конфигурации](/docs/img/install_select.png) 15 | 16 | ## Внимание! 17 | **Вы должны купить или найти бесплатное ДОМЕННОЕ ИМЯ (example.com), если собирайтесь использовать "Vless". Для "Shadowsocks" это НЕ НУЖНО.** 18 | 19 | P.s. [dnsexit](https://dnsexit.com/domains/free-second-level-domains/) - Похоже, этот сайт дает возможность зарегистрировать домен бесплатно. Но бесплатный период использования составляет 1 год. 20 | 21 | ## Аргументы: 22 | * --help - Вывести справочную информацию 23 | * --install - Установка Xray 24 | * --remove - Удаление Xray 25 | * --reinstall - Переустановка всех конфигураций и сервисов 26 | * --renew - Переустановка ТОЛЬКО конфигурационных файлов, без переустановки сервисов 27 | * --vless-qr - Выводит QR-код Vless в терминал 28 | * --vless-ws-qr - Выводит QR-код Vless WebSocket в терминал 29 | * --shadowsocks-qr - Выводит QR-код Shadowsocks в терминал 30 | 31 | ## Как использовать? 32 | 33 | ### Выполните эти строки до запуска скриптов! 34 | ```bash 35 | apt-get update 36 | apt-get -y install curl 37 | ``` 38 | 39 | ### Используйте удаленный скрипт 40 | #### Строка для установки 41 | ```bash 42 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --install 43 | ``` 44 | 45 | #### Строка для удаления 46 | ```bash 47 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --remove 48 | ``` 49 | 50 | #### Строка для переустановки 51 | ```bash 52 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --reinstall 53 | ``` 54 | 55 | #### Строка для обновления конфигурации 56 | ```bash 57 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --renew 58 | ``` 59 | 60 | #### Строка для получения QR-кода vless 61 | ```bash 62 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --vless-qr 63 | ``` 64 | 65 | #### Строка для получения QR-кода vless websocket 66 | ```bash 67 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --vless-ws-qr 68 | ``` 69 | 70 | #### Строка для получения QR-кода shadowsocks 71 | ```bash 72 | bash <(curl -s https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh) --shadowsocks-qr 73 | ``` 74 | 75 | ### ИЛИ Скачайте скрипт 76 | ```bash 77 | apy-get update 78 | apt-get install wget 79 | wget https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master/xvei.sh 80 | chmod +x xvei.sh 81 | ./xvei.sh 82 | ``` 83 | 84 | ## Где хранятся файлы? 85 | 86 | ### XRay конфиг 87 | ``` 88 | /usr/local/etc/xray/config.json 89 | ``` 90 | 91 | #### Печать содержимого файла 92 | ```bash 93 | cat /usr/local/etc/xray/config.json 94 | ``` 95 | ```bash 96 | echo $(cat /usr/local/etc/xray/config.json) 97 | ``` 98 | 99 | ### Vless TLS клиентский конфиг 100 | ``` 101 | /$HOME/xray_eis/vless_config.json 102 | ``` 103 | 104 | #### Печать содержимого файла 105 | ```bash 106 | cat /$HOME/xray_eis/vless_config.json 107 | ``` 108 | ```bash 109 | echo $(cat /$HOME/xray_eis/vless_config.json) 110 | ``` 111 | 112 | ### Vless TLS строка подключения 113 | ``` 114 | /$HOME/xray_eis/vless_link.txt 115 | ``` 116 | 117 | #### Печать содержимого файла 118 | ```bash 119 | cat /$HOME/xray_eis/vless_link.txt 120 | ``` 121 | ```bash 122 | echo $(cat /$HOME/xray_eis/vless_link.txt) 123 | ``` 124 | 125 | ### Vless WebSocket клиентский конфиг 126 | ``` 127 | /$HOME/xray_eis/vless_ws_config.json 128 | ``` 129 | 130 | #### Печать содержимого файла 131 | ```bash 132 | cat /$HOME/xray_eis/vless_ws_config.json 133 | ``` 134 | ```bash 135 | echo $(cat /$HOME/xray_eis/vless_ws_config.json) 136 | ``` 137 | 138 | ### Vless WebSocket строка подключения 139 | ``` 140 | /$HOME/xray_eis/vless_ws_link.txt 141 | ``` 142 | 143 | #### Печать содержимого файла 144 | ```bash 145 | cat /$HOME/xray_eis/vless_ws_link.txt 146 | ``` 147 | ```bash 148 | echo $(cat /$HOME/xray_eis/vless_ws_link.txt) 149 | ``` 150 | 151 | ### Shadowsocks клиентский конфиг 152 | ``` 153 | /$HOME/xray_eis/shadowsocks_config.json 154 | ``` 155 | 156 | #### Печать содержимого файла 157 | ```bash 158 | cat /$HOME/xray_eis/shadowsocks_config.json 159 | ``` 160 | ```bash 161 | echo $(cat /$HOME/xray_eis/shadowsocks_config.json) 162 | ``` 163 | 164 | ### Shadowsocks строка подключения 165 | ``` 166 | /$HOME/xray_eis/shadowsocks_link.txt 167 | ``` 168 | 169 | #### Печать содержимого файла 170 | ```bash 171 | cat /$HOME/xray_eis/shadowsocks_link.txt 172 | ``` 173 | ```bash 174 | echo $(cat /$HOME/xray_eis/shadowsocks_link.txt) 175 | ``` 176 | 177 | ## FAQ 178 | * Я не могу подключиться к сессии. 179 | * * Убедитесь, что ваш сервер не закрыт CDN (Например, Сloudflare Proxied). В этом случае вам придется использовать только Vless WebSocket или Shadowsocks соединение. Если домен возвращает реальный IP вашего сервера - вы можете использовать любой тип соединения. 180 | --- 181 | * Я вставляю текст для подключения в приложение, но ничего не получается. 182 | * * Некоторые приложения могут не поддерживать ссылки **vless://** и **ss://**. В этом случае необходимо использовать **полный конфигурационный файл**. Вы можете получить его, вызвав команду в терминале после установки: 183 | ```bash 184 | echo $(cat /$HOME/xray_eis/vless_config.json) 185 | ``` 186 | ```bash 187 | echo $(cat /$HOME/xray_eis/vless_ws_config.json) 188 | ``` 189 | ```bash 190 | echo $(cat /$HOME/xray_eis/shadowsocks_config.json) 191 | ``` 192 | 193 | ## Какое приложение я могу использовать? 194 | * [Nekoray (GitHub)](https://github.com/MatsuriDayo/nekoray/releases/latest) *I recommend it* 195 | * [Qv2ray (GitHub)](https://github.com/Qv2ray/Qv2ray/releases/latest) 196 | * [Hiddify](https://hiddify.com/) - Configuration files only! **vless://** & **ss://** may not process completely! 197 | * * [Android](https://play.google.com/store/apps/details?id=app.hiddify.com) 198 | * * [Windows](https://apps.microsoft.com/detail/9pdfnl3qv2s5) 199 | * * [Other](https://app.hiddify.com/) 200 | * [v2rayNG (GitHub)](https://github.com/2dust/v2rayNG/releases/latest) *I recommend it* 201 | * * [Android](https://play.google.com/store/apps/details?id=com.v2ray.ang) 202 | 203 | *P.s. Лично у меня возникают проблемы с **Hiddify** на моем устройстве **Android**. Я рекомендую использовать **v2rayNG**. На **Windows** - **Hiddify** работает отлично!* 204 | 205 | ## Рекомендация 206 | 207 | *Для выполнения этого шага убедитесь что у вас утсановлен [GeoSite](/v2ray_geo/geosite.dat) и [GeoIp](/v2ray_geo/geoip.dat)*. Если вы изпользуйте [Nekoray](https://github.com/MatsuriDayo/nekoray/releases/latest), то эти файлы уже должны быть предустановленны. 208 | 209 | На стороне клиента добавьте эти правила для доступа напрямую (*direct*), а не через туннель: 210 | 211 | **Для IP:** 212 | 213 | ``` 214 | geoip:private 215 | geoip:ru 216 | ``` 217 | 218 | **Для доменов:** 219 | 220 | ``` 221 | geosite:private 222 | geosite:vk 223 | geosite:mailru 224 | geosite:yandex 225 | geosite:category-ru 226 | geosite:category-gov-ru 227 | geosite:twitch 228 | geosite:steam 229 | geosite:epicgames 230 | regexp:^([\w\-\.]+\.)loc$ 231 | regexp:^([\w\-\.]+\.)local$ 232 | regexp:^([\w\-\.]+\.)ru$ 233 | regexp:^([\w\-\.]+\.)su$ 234 | regexp:^([\w\-\.]+\.)xn--p1ai$ 235 | regexp:^([\w\-\.]+\.)xn--p1acf$ 236 | regexp:^([\w\-\.]+\.)xn--80asehdb$ 237 | regexp:^([\w\-\.]+\.)xn--c1avg$ 238 | regexp:^([\w\-\.]+\.)xn--80aswg$ 239 | regexp:^([\w\-\.]+\.)xn--80adxhks$ 240 | regexp:^([\w\-\.]+\.)moscow$ 241 | regexp:^([\w\-\.]+\.)xn--d1acj3b$ 242 | ``` 243 | 244 | **Изображения для наглядности:** 245 | 246 | ![Открыть настройки](/docs/img/nekoray_route_1.png) 247 | 248 | ![Найти пункт меню](/docs/img/nekoray_route_2.png) 249 | 250 | ![Заполнить поля](/docs/img/nekoray_route_3.png) 251 | 252 | ![Сохранить](/docs/img/nekoray_route_4.png) -------------------------------------------------------------------------------- /docs/img/install_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/docs/img/install_select.png -------------------------------------------------------------------------------- /docs/img/nekoray_route_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/docs/img/nekoray_route_1.png -------------------------------------------------------------------------------- /docs/img/nekoray_route_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/docs/img/nekoray_route_2.png -------------------------------------------------------------------------------- /docs/img/nekoray_route_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/docs/img/nekoray_route_3.png -------------------------------------------------------------------------------- /docs/img/nekoray_route_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/docs/img/nekoray_route_4.png -------------------------------------------------------------------------------- /v2ray_geo/geoip.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/v2ray_geo/geoip.dat -------------------------------------------------------------------------------- /v2ray_geo/geosite.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/4cf74e64e705d1791edce11f10fcb510a2e7e317/v2ray_geo/geosite.dat -------------------------------------------------------------------------------- /xvei.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SCRIPT 4 | XRAY_GIT_SCRIPT="https://github.com/XTLS/Xray-install/raw/main/install-release.sh" 5 | ROOT_GIT_REPO="https://raw.githubusercontent.com/Shark-vil/xray_vless_easy_install_script/master" 6 | # -------------- 7 | 8 | # REPO CONFIG 9 | # XRAY 10 | REPO_XRAY_GEOIP="$ROOT_GIT_REPO/v2ray_geo/geoip.dat" 11 | REPO_XRAY_GEOSITE="$ROOT_GIT_REPO/v2ray_geo/geosite.dat" 12 | REPO_XRAY_CONFIG_VLESS="$ROOT_GIT_REPO/config/xray/user/vless.json" 13 | REPO_XRAY_CONFIG_VLESS_LINK="$ROOT_GIT_REPO/config/xray/user/vless_link.txt" 14 | REPO_XRAY_CONFIG_VLESS_WS="$ROOT_GIT_REPO/config/xray/user/vless_ws.json" 15 | REPO_XRAY_CONFIG_VLESS_WS_LINK="$ROOT_GIT_REPO/config/xray/user/vless_ws_link.txt" 16 | REPO_XRAY_CONFIG_SHADOWSOCKS="$ROOT_GIT_REPO/config/xray/user/shadowsocks.txt" 17 | REPO_XRAY_CONFIG_SHADOWSOCKS_LINK="$ROOT_GIT_REPO/config/xray/user/shadowsocks_link.txt" 18 | # NGINX 19 | REPO_NGINX_CONFIG="$ROOT_GIT_REPO/config/nginx/default" 20 | # -------------- 21 | 22 | # NGINX CONFIG 23 | NGINX_DEFAULT_CONFIG_SRC="/etc/nginx/sites-available/default" 24 | NGINX_DEFAULT_CONFIG_LINK="/etc/nginx/sites-enabled/default" 25 | NGINX_NEW_CONFIG="/etc/nginx/sites-enabled/default.conf" 26 | # -------------- 27 | 28 | # PATH 29 | CONFIG_DIST_PATH="$HOME/xray_eis" 30 | CONFIG_VLESS_PATH="$CONFIG_DIST_PATH/vless_config.json" 31 | CONFIG_VLESS_LINK_PATH="$CONFIG_DIST_PATH/vless_link.txt" 32 | CONFIG_VLESS_WS_PATH="$CONFIG_DIST_PATH/vless_ws_config.json" 33 | CONFIG_VLESS_WS_LINK_PATH="$CONFIG_DIST_PATH/vless_ws_link.txt" 34 | CONFIG_VLESS_SHADOWSOCKS_PATH="$CONFIG_DIST_PATH/shadowsocks_config.json" 35 | CONFIG_VLESS_SHADOWSOCKS_LINK_PATH="$CONFIG_DIST_PATH/shadowsocks_link.txt" 36 | CONFIG_XRAY_DIR_PATH="/usr/local/etc/xray" 37 | CONFIG_XRAY_PATH="$CONFIG_XRAY_DIR_PATH/config.json" 38 | CONFIG_XRAY_TMP_PATH="$CONFIG_XRAY_DIR_PATH/config.tmp.json" 39 | # -------------- 40 | 41 | # VALUE 42 | XRAY_SHADOWSOCKS_PORT_DEFAULT="5465" 43 | PARAM_RENEW_CONFIG="0" 44 | VALUE_ENCRYPTION_METHOD="2022-blake3-aes-128-gcm" 45 | VALUE_XRAY_SHADOWSOCKS_PORT="$XRAY_SHADOWSOCKS_PORT_DEFAULT" 46 | VALUE_OUTBOUNDS_PROXY="" 47 | VALUE_INBOUNDS_VLESS_WS="0" 48 | VALUE_INBOUNDS_VLESS_TLS="0" 49 | VALUE_INBOUNDS_SHADOWSOCKS="0" 50 | # -------------- 51 | 52 | print_log() { 53 | local message="$1" 54 | local prefix_color="\033[96m" 55 | local reset_color="\033[0m" 56 | local prefix="[Xray|INFO] " 57 | echo -e "${prefix_color}${prefix}${reset_color}${message}" 58 | } 59 | 60 | print_error() { 61 | local message="$1" 62 | local prefix_color="\033[91m" 63 | local reset_color="\033[0m" 64 | local prefix="[Xray|ERROR] " 65 | echo -e "${prefix_color}${prefix}${reset_color}${message}" 66 | } 67 | 68 | jq_builder() { 69 | jq "$1" "$CONFIG_XRAY_PATH" > "$CONFIG_XRAY_TMP_PATH" && mv "$CONFIG_XRAY_TMP_PATH" "$CONFIG_XRAY_PATH" 70 | # print_log "JSON Builder: $(cat "$CONFIG_XRAY_PATH")" 71 | } 72 | 73 | jq_add_to_array() { 74 | key="$1" 75 | value="$2" 76 | jq "$key += [$value]" "$CONFIG_XRAY_PATH" > "$CONFIG_XRAY_TMP_PATH" && mv "$CONFIG_XRAY_TMP_PATH" "$CONFIG_XRAY_PATH" 77 | # print_log "JSON Builder: $(cat "$CONFIG_XRAY_PATH")" 78 | } 79 | 80 | jq_add_to_object() { 81 | key="$1" 82 | subkey="$2" 83 | value="$3" 84 | jq "$key.$subkey = $value" "$CONFIG_XRAY_PATH" > "$CONFIG_XRAY_TMP_PATH" && mv "$CONFIG_XRAY_TMP_PATH" "$CONFIG_XRAY_PATH" 85 | # print_log "JSON Builder: $(cat "$CONFIG_XRAY_PATH")" 86 | } 87 | 88 | write_text_in_file() { 89 | local file_path=$1 90 | local write_content=$2 91 | 92 | if [ ! -e $file_path ]; then 93 | touch $file_path 94 | fi 95 | echo "$write_content" > "$file_path" 96 | } 97 | 98 | check_service() { 99 | if systemctl is-active --quiet $1; then 100 | print_log "The '$1' service is working correctly!" 101 | else 102 | print_error "The '$1' service is running with errors!" 103 | fi 104 | } 105 | 106 | apt_update() { 107 | print_log "Updating package lists" 108 | if command -v apt-get &>/dev/null; then 109 | apt-get update 110 | elif command -v dnf &>/dev/null; then 111 | dnf check-update 112 | elif command -v yum &>/dev/null; then 113 | yum check-update 114 | elif command -v zypper &>/dev/null; then 115 | zypper refresh 116 | elif command -v pacman &>/dev/null; then 117 | pacman -Sy 118 | else 119 | print_log "Unsupported package manager" 120 | return 1 121 | fi 122 | } 123 | 124 | apt_install() { 125 | print_log "Installing package '$1'" 126 | if command -v apt-get &>/dev/null; then 127 | apt-get install -y "$1" 128 | elif command -v dnf &>/dev/null; then 129 | dnf install -y "$1" 130 | elif command -v yum &>/dev/null; then 131 | yum install -y "$1" 132 | elif command -v zypper &>/dev/null; then 133 | zypper install -y "$1" 134 | elif command -v pacman &>/dev/null; then 135 | pacman -S --noconfirm "$1" 136 | else 137 | print_log "Unsupported package manager" 138 | return 1 139 | fi 140 | } 141 | 142 | confirm_changes() { 143 | local prompt="$1" 144 | local green="\033[32m" 145 | local red="\033[31m" 146 | local reset="\033[0m" 147 | local confirm_value 148 | local response 149 | 150 | while true; do 151 | local confirm_value 152 | 153 | print_log "${prompt} (${green}Yes${reset}/${red}No${reset}): " 154 | read confirm_value < /dev/tty 155 | 156 | confirm_value=$(echo "$confirm_value" | tr '[:upper:]' '[:lower:]') 157 | 158 | case "$confirm_value" in 159 | d | y | yes) 160 | return 0 161 | ;; 162 | n | no) 163 | return 1 164 | ;; 165 | *) 166 | ;; 167 | esac 168 | done 169 | } 170 | 171 | is_number() { 172 | local value="$1" 173 | 174 | if [[ "$value" =~ ^-?[0-9]+$ ]]; then 175 | return 0; 176 | else 177 | return 1; 178 | fi 179 | } 180 | 181 | replace_text_in_file() { 182 | sed -i "s|%$1%|$2|g" "$3" 183 | print_log "SET $1=$2 IN $3" 184 | } 185 | 186 | install_tor_network() { 187 | apt_update 188 | apt_install "tor" 189 | } 190 | 191 | install_warp_docker() { 192 | if docker ps -a --format '{{.Names}}' | grep -q "^warp-xray$"; then 193 | return 0 194 | fi 195 | 196 | if [ ! -d "$HOME/warp-xray/data" ]; then 197 | mkdir -p "$HOME/warp-xray/data" 198 | fi 199 | 200 | docker run -d \ 201 | --name warp-xray \ 202 | --restart always \ 203 | -p 1080:1080 \ 204 | -e WARP_SLEEP=2 \ 205 | --cap-add NET_ADMIN \ 206 | --sysctl net.ipv6.conf.all.disable_ipv6=0 \ 207 | --sysctl net.ipv4.conf.all.src_valid_mark=1 \ 208 | -v $HOME/warp-xray/data:/var/lib/cloudflare-warp \ 209 | caomingjun/warp 210 | } 211 | 212 | install_docker() { 213 | DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]') 214 | 215 | if [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ubuntu" ]; then 216 | if dpkg -l | grep -q docker-ce; then 217 | return 0 218 | fi 219 | 220 | apt-get update 221 | apt-get install -y ca-certificates curl lsb-release 222 | install -m 0755 -d /etc/apt/keyrings 223 | curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg -o /etc/apt/keyrings/docker.asc 224 | chmod a+r /etc/apt/keyrings/docker.asc 225 | 226 | if [ "$DISTRO" == "debian" ]; then 227 | REPO_URL="https://download.docker.com/linux/debian" 228 | else 229 | REPO_URL="https://download.docker.com/linux/ubuntu" 230 | fi 231 | 232 | echo \ 233 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] $REPO_URL \ 234 | $(lsb_release -cs) stable" | \ 235 | tee /etc/apt/sources.list.d/docker.list > /dev/null 236 | apt-get update 237 | 238 | apt-get install -y docker-ce \ 239 | docker-ce-cli \ 240 | containerd.io \ 241 | docker-buildx-plugin \ 242 | docker-compose-plugin 243 | elif [ "$DISTRO" == "centos" ] || [ "$DISTRO" == "rhel" ] || [ "$DISTRO" == "fedora" ]; then 244 | if rpm -q docker-ce; then 245 | return 0 246 | fi 247 | 248 | yum install -y dnf-utils 249 | dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 250 | 251 | dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 252 | 253 | systemctl start docker 254 | systemctl enable docker 255 | else 256 | print_error "Support Docker for this distribution is not implemented." 257 | fi 258 | } 259 | 260 | set_encryption_method() { 261 | local select_type_number 262 | while true; do 263 | print_log "Choise shadowsocks encryption method (Default: 2022-blake3-aes-128-gcm, Press \"Enter\" to skip):" 264 | print_log "1. 2022-blake3-aes-128-gcm" 265 | print_log "2. 2022-blake3-aes-256-gcm" 266 | print_log "3. 2022-blake3-chacha20-poly1305" 267 | print_log "4. aes-128-gcm" 268 | print_log "5. aes-256-gcm" 269 | print_log "6. chacha20-poly1305" 270 | print_log "7. chacha20-ietf-poly1305" 271 | print_log "8. xchacha20-poly1305" 272 | print_log "9. xchacha20-ietf-poly1305" 273 | read -r select_type_number < /dev/tty 274 | case "$select_type_number" in 275 | 1) 276 | VALUE_ENCRYPTION_METHOD="2022-blake3-aes-128-gcm" 277 | ;; 278 | 2) 279 | VALUE_ENCRYPTION_METHOD="2022-blake3-aes-256-gcm" 280 | ;; 281 | 3) 282 | VALUE_ENCRYPTION_METHOD="2022-blake3-chacha20-poly1305" 283 | ;; 284 | 4) 285 | VALUE_ENCRYPTION_METHOD="aes-128-gcm" 286 | ;; 287 | 5) 288 | VALUE_ENCRYPTION_METHOD="aes-256-gcm" 289 | ;; 290 | 6) 291 | VALUE_ENCRYPTION_METHOD="chacha20-poly1305" 292 | ;; 293 | 7) 294 | VALUE_ENCRYPTION_METHOD="chacha20-ietf-poly1305" 295 | ;; 296 | 8) 297 | VALUE_ENCRYPTION_METHOD="xchacha20-poly1305" 298 | ;; 299 | 9) 300 | VALUE_ENCRYPTION_METHOD="xchacha20-ietf-poly1305" 301 | ;; 302 | *) 303 | VALUE_ENCRYPTION_METHOD="2022-blake3-aes-128-gcm" 304 | ;; 305 | esac 306 | if confirm_changes "'$VALUE_ENCRYPTION_METHOD' - Is this the correct method?"; then 307 | break 308 | fi 309 | print_error "Method not correct. Try again." 310 | done 311 | } 312 | 313 | read_domain() { 314 | while true; do 315 | print_log "Print your REAL domain name (example: mysite.com):" 316 | read -r VALUE_YOUR_DOMAIN < /dev/tty 317 | if confirm_changes "'$VALUE_YOUR_DOMAIN' - Is this the correct domain?"; then 318 | break 319 | fi 320 | print_error "Domain not correct. Try again." 321 | done 322 | } 323 | 324 | read_mail() { 325 | while true; do 326 | print_log "Print your REAL email (example: mymail@gmail.com):" 327 | read -r VALUE_YOUR_EMAIL < /dev/tty 328 | if confirm_changes "'$VALUE_YOUR_EMAIL' - Is this the correct domain?"; then 329 | break 330 | fi 331 | print_error "Mail not correct. Try again." 332 | done 333 | } 334 | 335 | set_shadowsocks_port() { 336 | while true; do 337 | print_log "Print shadowsocks port (default: $XRAY_SHADOWSOCKS_PORT_DEFAULT, Press \"Enter\" to skip):" 338 | read VALUE_XRAY_SHADOWSOCKS_PORT < /dev/tty 339 | if ! is_number $VALUE_XRAY_SHADOWSOCKS_PORT; then 340 | VALUE_XRAY_SHADOWSOCKS_PORT="$XRAY_SHADOWSOCKS_PORT_DEFAULT" 341 | fi 342 | if ss -tuln | grep -q ":$VALUE_XRAY_SHADOWSOCKS_PORT"; then 343 | print_error "The port $VALUE_XRAY_SHADOWSOCKS_PORT is already in use" 344 | VALUE_XRAY_SHADOWSOCKS_PORT="$XRAY_SHADOWSOCKS_PORT_DEFAULT" 345 | fi 346 | if confirm_changes "Port: $VALUE_XRAY_SHADOWSOCKS_PORT. Is this the correct port?"; then 347 | break 348 | fi 349 | done 350 | } 351 | 352 | letsencrypt_install_cert_from_domain() { 353 | local domain=$1 354 | local mail=$2 355 | 356 | VALUE_LETSENCRYPT_FULLCHAIN="/etc/letsencrypt/live/$domain/fullchain.pem" 357 | VALUE_LETSENCRYPT_PRIVKEY="/etc/letsencrypt/live/$domain/privkey.pem" 358 | 359 | if [ -e $VALUE_LETSENCRYPT_FULLCHAIN ] && [ -e $VALUE_LETSENCRYPT_PRIVKEY ]; then 360 | print_log "SSL certificates are already installed" 361 | else 362 | print_log "Installing SSL certificates" 363 | certbot certonly --standalone --non-interactive --agree-tos --email $mail -d $domain 364 | fi 365 | 366 | local letsencrypt_domain_conf="/etc/letsencrypt/renewal/$domain.conf" 367 | local letsencrypt_add_line="renew_hook = systemctl reload xray" 368 | 369 | if ! grep -Fxq "$letsencrypt_add_line" "$letsencrypt_domain_conf"; then 370 | echo "$letsencrypt_add_line" >> "$letsencrypt_domain_conf" 371 | fi 372 | } 373 | 374 | nginx_update_default_config() { 375 | print_log "Replace default nginx config" 376 | if [ -e $NGINX_DEFAULT_CONFIG_LINK ]; then 377 | rm -f $NGINX_DEFAULT_CONFIG_LINK 378 | fi 379 | wget -q --show-progress -O $NGINX_NEW_CONFIG $REPO_NGINX_CONFIG 380 | } 381 | 382 | xray_update_config_template() { 383 | local user_password_base64=$(openssl rand -base64 16) 384 | local user_uuid=$(cat /proc/sys/kernel/random/uuid) 385 | local ws_path="$(tr -dc 'a-z' < /dev/urandom | head -c 24)" 386 | 387 | if [ -f "$CONFIG_XRAY_PATH" ]; then 388 | rm "$CONFIG_XRAY_PATH" 389 | fi 390 | 391 | if [ -f "$CONFIG_XRAY_TMP_PATH" ]; then 392 | rm "$CONFIG_XRAY_TMP_PATH" 393 | fi 394 | 395 | echo "{}" > "$CONFIG_XRAY_PATH" 396 | 397 | jq_builder '.log = { "loglevel": "info" }' 398 | jq_builder '.routing.rules = []' 399 | jq_builder '.routing.rules += [ 400 | { "type": "field", "outboundTag": "block", "port": "135, 137, 138, 139" }, 401 | { "type": "field", "outboundTag": "block", "protocol": ["bittorrent"] }, 402 | { "type": "field", "outboundTag": "block", "ip": ["geoip:private"] } 403 | ]' 404 | 405 | local route_proxy_tags="" 406 | if [ -n "$VALUE_OUTBOUNDS_PROXY" ]; then 407 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 408 | route_proxy_tags+="\"ss\"," 409 | fi 410 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ]; then 411 | route_proxy_tags+="\"vless_tls\"," 412 | fi 413 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 414 | route_proxy_tags+="\"vless_ws\"," 415 | fi 416 | route_proxy_tags=$(echo "$route_proxy_tags" | sed 's/.$//') 417 | fi 418 | 419 | case "$VALUE_OUTBOUNDS_PROXY" in 420 | "tor") 421 | jq_builder '.routing.rules += [{ "type": "field", "inboundTag": ['"$route_proxy_tags"'], "outboundTag": "tor_proxy" }]' 422 | ;; 423 | "warp") 424 | jq_builder '.routing.rules += [{ "type": "field", "inboundTag": ['"$route_proxy_tags"'], "outboundTag": "warp_proxy" }]' 425 | ;; 426 | *) 427 | jq_builder '.routing.rules += [{ "type": "field", "outboundTag": "direct", "network": "tcp,udp", "ip": ["0.0.0.0/0", "::/0"] }]' 428 | ;; 429 | esac 430 | jq_add_to_object ".routing" "domainStrategy" "\"AsIs\"" 431 | jq_builder '.inbounds = []' 432 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 433 | jq_builder '.inbounds += [ 434 | { 435 | "port": '"$VALUE_XRAY_SHADOWSOCKS_PORT"', 436 | "tag": "ss", 437 | "protocol": "shadowsocks", 438 | "settings": { 439 | "method": '"\"$VALUE_ENCRYPTION_METHOD\""', 440 | "password": '"\"$user_password_base64\""', 441 | "network": "tcp,udp" 442 | } 443 | } 444 | ]' 445 | fi 446 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ] || [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ]; then 447 | jq_builder '.inbounds += [ 448 | { 449 | "port": 443, 450 | "protocol": "vless", 451 | "tag": "vless_tls", 452 | "settings": { 453 | "clients": [ 454 | { 455 | "id": '"\"$user_uuid\""', 456 | "email": '"\"$VALUE_YOUR_EMAIL\""', 457 | "flow": "xtls-rprx-vision" 458 | } 459 | ], 460 | "decryption": "none", 461 | "fallbacks": [] 462 | }, 463 | "streamSettings": { 464 | "network": "tcp", 465 | "security": "tls", 466 | "tlsSettings": { 467 | "alpn": [ 468 | "http/1.1", 469 | "h2" 470 | ], 471 | "certificates": [ 472 | { 473 | "certificateFile": '"\"$VALUE_LETSENCRYPT_FULLCHAIN\""', 474 | "keyFile": '"\"$VALUE_LETSENCRYPT_PRIVKEY\""' 475 | } 476 | ] 477 | } 478 | }, 479 | "sniffing": { 480 | "enabled": true, 481 | "destOverride": [ 482 | "http", 483 | "tls" 484 | ] 485 | } 486 | } 487 | ]' 488 | 489 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 490 | jq_builder '.inbounds |= map(if .tag == "vless_tls" then .settings.fallbacks += [{"path": '"\"/$ws_path\""', "dest": "@vless-ws"}, {"dest": "8080"}] else . end)' 491 | else 492 | jq_builder '.inbounds |= map(if .tag == "vless_tls" then .settings.fallbacks += [{"dest": "8080"}] else . end)' 493 | fi 494 | fi 495 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 496 | jq_builder '.inbounds += [ 497 | { 498 | "listen": "@vless-ws", 499 | "protocol": "vless", 500 | "tag": "vless_ws", 501 | "settings": { 502 | "clients": [ 503 | { 504 | "id": '"\"$user_uuid\""', 505 | "email": '"\"$VALUE_YOUR_EMAIL\""' 506 | } 507 | ], 508 | "decryption": "none" 509 | }, 510 | "streamSettings": { 511 | "network": "ws", 512 | "security": "none", 513 | "wsSettings": { 514 | "path": '"\"/$ws_path\""' 515 | } 516 | } 517 | } 518 | ]' 519 | fi 520 | jq_builder '.outbounds = []' 521 | jq_builder '.outbounds += [ 522 | { "protocol": "freedom", "tag": "direct" }, 523 | { "protocol": "blackhole", "tag": "block" } 524 | ]' 525 | case "$VALUE_OUTBOUNDS_PROXY" in 526 | "tor") 527 | jq_builder '.outbounds += [ 528 | { 529 | "protocol": "socks", 530 | "tag": "tor_proxy", 531 | "settings": { 532 | "servers": [ 533 | { 534 | "address": "127.0.0.1", 535 | "port": 9050 536 | } 537 | ] 538 | } 539 | } 540 | ]' 541 | ;; 542 | "warp") 543 | jq_builder '.outbounds += [ 544 | { 545 | "protocol": "socks", 546 | "tag": "warp_proxy", 547 | "settings": { 548 | "servers": [ 549 | { 550 | "address": "127.0.0.1", 551 | "port": 1080 552 | } 553 | ] 554 | } 555 | } 556 | ]' 557 | ;; 558 | *) 559 | ;; 560 | esac 561 | 562 | wget -q --show-progress -nc -P $CONFIG_XRAY_DIR_PATH $REPO_XRAY_GEOIP 563 | wget -q --show-progress -nc -P $CONFIG_XRAY_DIR_PATH $REPO_XRAY_GEOSITE 564 | 565 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ]; then 566 | wget -q --show-progress -O $CONFIG_VLESS_PATH $REPO_XRAY_CONFIG_VLESS 567 | wget -q --show-progress -O $CONFIG_VLESS_LINK_PATH $REPO_XRAY_CONFIG_VLESS_LINK 568 | fi 569 | 570 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 571 | wget -q --show-progress -O $CONFIG_VLESS_WS_PATH $REPO_XRAY_CONFIG_VLESS_WS 572 | wget -q --show-progress -O $CONFIG_VLESS_WS_LINK_PATH $REPO_XRAY_CONFIG_VLESS_WS_LINK 573 | fi 574 | 575 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 576 | wget -q --show-progress -O $CONFIG_VLESS_SHADOWSOCKS_PATH $REPO_XRAY_CONFIG_SHADOWSOCKS 577 | wget -q --show-progress -O $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH $REPO_XRAY_CONFIG_SHADOWSOCKS_LINK 578 | fi 579 | 580 | for path in "$CONFIG_VLESS_PATH" "$CONFIG_VLESS_LINK_PATH" "$CONFIG_VLESS_WS_PATH" "$CONFIG_VLESS_WS_LINK_PATH" "$CONFIG_VLESS_SHADOWSOCKS_PATH" "$CONFIG_VLESS_SHADOWSOCKS_LINK_PATH"; do 581 | if [ ! -f "$path" ]; then 582 | continue 583 | fi 584 | replace_text_in_file "CLIENT_UUID" $user_uuid $path 585 | replace_text_in_file "CLIENT_MAIL" $VALUE_YOUR_EMAIL $path 586 | replace_text_in_file "WEBSOCKET_PATH" $ws_path $path 587 | replace_text_in_file "DOMAIN_NAME" $VALUE_YOUR_DOMAIN $path 588 | replace_text_in_file "PASSWORD" $user_password_base64 $path 589 | replace_text_in_file "SERVER_IP" $(curl -s ifconfig.me) $path 590 | replace_text_in_file "SHADOWSOCKS_PORT" $VALUE_XRAY_SHADOWSOCKS_PORT $path 591 | replace_text_in_file "ENCRYPTION_METHOD" $VALUE_ENCRYPTION_METHOD $path 592 | replace_text_in_file "LETSENCRYPT_FULLCHAIN" $VALUE_LETSENCRYPT_FULLCHAIN $path 593 | replace_text_in_file "LETSENCRYPT_PRIVKEY" $VALUE_LETSENCRYPT_PRIVKEY $path 594 | done 595 | } 596 | 597 | print_result_install() { 598 | print_log "Your user config:" 599 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ]; then 600 | print_log "---------------------" 601 | print_log "> VLESS CONNECT LUNK <" 602 | print_log $(cat $CONFIG_VLESS_LINK_PATH) 603 | print_log "---------------------" 604 | fi 605 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 606 | print_log "---------------------" 607 | print_log "> VLESS WEBSOCKET CONNECT LUNK <" 608 | print_log $(cat $CONFIG_VLESS_WS_LINK_PATH) 609 | print_log "---------------------" 610 | fi 611 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 612 | print_log "---------------------" 613 | print_log "> SHADOWSOCKS CONNECT LUNK <" 614 | print_log $(cat $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH) 615 | print_log "---------------------" 616 | fi 617 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ]; then 618 | print_log "---------------------" 619 | print_log "Vless link path: $CONFIG_VLESS_LINK_PATH" 620 | print_log "Vless config path: $CONFIG_VLESS_PATH" 621 | print_log "---------------------" 622 | fi 623 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 624 | print_log "---------------------" 625 | print_log "Vless WebSocket link path: $CONFIG_VLESS_WS_LINK_PATH" 626 | print_log "Vless WebSocket config path: $CONFIG_VLESS_WS_PATH" 627 | print_log "---------------------" 628 | fi 629 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 630 | print_log "---------------------" 631 | print_log "Shadowsocks link path: $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH" 632 | print_log "Shadowsocks config path: $CONFIG_VLESS_SHADOWSOCKS_PATH" 633 | print_log "---------------------" 634 | fi 635 | print_log "@+@+@+@+@+@+@+@+@+@+@" 636 | print_log "Allow installed!" 637 | print_log "@+@+@+@+@+@+@+@+@+@+@" 638 | } 639 | 640 | remove_xray() { 641 | docker rm -f waro-xray 642 | systemctl stop nginx.service 643 | systemctl stop xray.service 644 | if [ -e $CONFIG_DIST_PATH ]; then 645 | rm -rf $CONFIG_DIST_PATH 646 | print_log "Remove: '$CONFIG_DIST_PATH'" 647 | fi 648 | if [ -e "$HOME/warp-xray" ]; then 649 | rm -rf "$HOME/warp-xray" 650 | print_log "Remove: '$HOME/warp-xray'" 651 | fi 652 | if [ -e $NGINX_NEW_CONFIG ]; then 653 | rm -f $NGINX_NEW_CONFIG 654 | print_log "Remove: '$NGINX_NEW_CONFIG'" 655 | fi 656 | if [ -e $NGINX_DEFAULT_CONFIG_SRC ] && [ ! -e $NGINX_DEFAULT_CONFIG_LINK ]; then 657 | ln -s $NGINX_DEFAULT_CONFIG_SRC $NGINX_DEFAULT_CONFIG_LINK 658 | print_log "Link: '$NGINX_DEFAULT_CONFIG_LINK'" 659 | fi 660 | if [ -e $CONFIG_XRAY_PATH ]; then 661 | rm -f $CONFIG_XRAY_PATH 662 | print_log "Remove: '$CONFIG_XRAY_PATH'" 663 | fi 664 | print_log "Remove git script '$XRAY_GIT_SCRIPT'" 665 | bash -c "$(curl -L $XRAY_GIT_SCRIPT)" @ remove --purge 666 | systemctl start nginx.service 667 | print_log "Start nginx service" 668 | check_service "nginx" 669 | } 670 | 671 | set_outbounds_proxy() { 672 | if ! confirm_changes "Do you want to hide the server IP to the outside world? (WARNING: Connection speed via double proxy will be lower!)"; then 673 | return 0 674 | fi 675 | 676 | local select_type_number 677 | while true; do 678 | print_log "Select the type of proxy (Default: WARP, Press \"Enter\" to skip):" 679 | print_log "1. WARP (Cloudflare)" 680 | print_log "2. TOR (Tor network)" 681 | read -r select_type_number < /dev/tty 682 | case "$select_type_number" in 683 | 1) 684 | VALUE_OUTBOUNDS_PROXY="warp" 685 | ;; 686 | 2) 687 | VALUE_OUTBOUNDS_PROXY="tor" 688 | ;; 689 | *) 690 | VALUE_OUTBOUNDS_PROXY="warp" 691 | ;; 692 | esac 693 | if confirm_changes "'$VALUE_OUTBOUNDS_PROXY' - Is this the correct method?"; then 694 | break 695 | fi 696 | print_error "Method not correct. Try again." 697 | done 698 | } 699 | 700 | set_xray_inbounds() { 701 | local select_type_number 702 | local green="\033[32m" 703 | local red="\033[31m" 704 | local reset="\033[0m" 705 | while true; do 706 | print_log "Choose how you want to configure XRay:" 707 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "0" ]; then 708 | print_log "1. Vless TLS (${red}Not selected${reset})" 709 | else 710 | print_log "1. Vless TLS (${green}Selected${reset})" 711 | fi 712 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "0" ]; then 713 | print_log "2. Vless WebSocket (${red}Not selected${reset})" 714 | else 715 | print_log "2. Vless WebSocket (${green}Selected${reset})" 716 | fi 717 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "0" ]; then 718 | print_log "3. Shadowsocks (${red}Not selected${reset})" 719 | else 720 | print_log "3. Shadowsocks (${green}Selected${reset})" 721 | fi 722 | print_log "0. Complete selection and continue" 723 | read -r select_type_number < /dev/tty 724 | case "$select_type_number" in 725 | 0) 726 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "0" ] && [ "$VALUE_INBOUNDS_VLESS_WS" = "0" ] && [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "0" ]; then 727 | print_error "At least one item must be selected!" 728 | elif confirm_changes "Complete selection?"; then 729 | break 730 | fi 731 | ;; 732 | 1) 733 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "0" ]; then 734 | VALUE_INBOUNDS_VLESS_TLS="1" 735 | else 736 | VALUE_INBOUNDS_VLESS_TLS="0" 737 | fi 738 | ;; 739 | 2) 740 | if [ "$VALUE_INBOUNDS_VLESS_WS" = "0" ]; then 741 | VALUE_INBOUNDS_VLESS_WS="1" 742 | else 743 | VALUE_INBOUNDS_VLESS_WS="0" 744 | fi 745 | ;; 746 | 3) 747 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "0" ]; then 748 | VALUE_INBOUNDS_SHADOWSOCKS="1" 749 | else 750 | VALUE_INBOUNDS_SHADOWSOCKS="0" 751 | fi 752 | ;; 753 | *) 754 | print_error "Method not correct. Try again." 755 | ;; 756 | esac 757 | done 758 | } 759 | 760 | install_xray() { 761 | if [ "$PARAM_RENEW_CONFIG" = "0" ]; then 762 | apt_update 763 | apt_install "curl" 764 | 765 | if ! curl --head --silent --fail "$XRAY_GIT_SCRIPT" > /dev/null; then 766 | echo "File $XRAY_GIT_SCRIPT not found :(" 767 | return 0 768 | fi 769 | 770 | apt_install "ca-certificates" 771 | apt_install "wget" 772 | apt_install "git" 773 | apt_install "nginx" 774 | apt_install "certbot" 775 | apt_install "qrencode" 776 | apt_install "jq" 777 | 778 | print_log "Run git script '$XRAY_GIT_SCRIPT'" 779 | bash -c "$(curl -L $XRAY_GIT_SCRIPT)" @ install -u root 780 | fi 781 | 782 | set_xray_inbounds 783 | 784 | if [ "$VALUE_INBOUNDS_VLESS_TLS" = "1" ] || [ "$VALUE_INBOUNDS_VLESS_WS" = "1" ]; then 785 | read_domain 786 | read_mail 787 | systemctl stop nginx.service > /dev/null 788 | letsencrypt_install_cert_from_domain $VALUE_YOUR_DOMAIN $VALUE_YOUR_EMAIL 789 | systemctl start nginx.service > /dev/null 790 | fi 791 | 792 | systemctl stop xray.service > /dev/null 793 | 794 | if [ -d "$CONFIG_DIST_PATH" ]; then 795 | rm -r "$CONFIG_DIST_PATH" 796 | fi 797 | 798 | mkdir "$CONFIG_DIST_PATH" 799 | 800 | if [ "$VALUE_INBOUNDS_SHADOWSOCKS" = "1" ]; then 801 | set_shadowsocks_port 802 | set_encryption_method 803 | fi 804 | 805 | set_outbounds_proxy 806 | 807 | case "$VALUE_OUTBOUNDS_PROXY" in 808 | "tor") 809 | install_tor_network 810 | ;; 811 | "warp") 812 | install_docker 813 | install_warp_docker 814 | ;; 815 | *) 816 | ;; 817 | esac 818 | 819 | xray_update_config_template 820 | nginx_update_default_config 821 | 822 | journalctl --vacuum-time=1s -u xray > /dev/null 823 | systemctl restart systemd-journald > /dev/null 824 | systemctl start xray.service > /dev/null 825 | 826 | check_service "nginx" 827 | check_service "xray" 828 | 829 | print_result_install 830 | } 831 | 832 | print_help() { 833 | print_log "Arguments:" 834 | print_log "--help - Print help info" 835 | print_log "--install - Installing Xray" 836 | print_log "--remove - Deletes Xray" 837 | print_log "--reinstall - Reinstalls all configs and services" 838 | print_log "--renew - Reinstalls ONLY configuration files, without reinstalling services" 839 | print_log "--vless-qr - Outputs the Vless connection code to the terminal" 840 | print_log "--vless-ws-qr - Outputs the Vless WebSocket connection code to the terminal" 841 | print_log "--shadowsocks-qr - Outputs the Shadowsocks connection code to the terminal" 842 | } 843 | 844 | while [[ $# -gt 0 ]]; do 845 | case $1 in 846 | --help) 847 | print_help 848 | exit 0 849 | ;; 850 | --install) 851 | install_xray 852 | exit 0 853 | ;; 854 | --reinstall) 855 | remove_xray 856 | install_xray 857 | exit 0 858 | ;; 859 | --renew) 860 | PARAM_RENEW_CONFIG="1" 861 | install_xray 862 | exit 0 863 | ;; 864 | --vless-qr) 865 | if [ -e $CONFIG_VLESS_LINK_PATH ]; then 866 | qrencode -t ASCII "$(cat $CONFIG_VLESS_LINK_PATH)" 867 | else 868 | print_error "File $CONFIG_VLESS_LINK_PATH not found!" 869 | fi 870 | exit 0 871 | ;; 872 | --vless-ws-qr) 873 | if [ -e $CONFIG_VLESS_WS_LINK_PATH ]; then 874 | qrencode -t ASCII "$(cat $CONFIG_VLESS_WS_LINK_PATH)" 875 | else 876 | print_error "File $CONFIG_VLESS_WS_LINK_PATH not found!" 877 | fi 878 | exit 0 879 | ;; 880 | --shadowsocks-qr) 881 | if [ -e $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH ]; then 882 | qrencode -t ASCII "$(cat $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH)" 883 | else 884 | print_error "File $CONFIG_VLESS_SHADOWSOCKS_LINK_PATH not found!" 885 | fi 886 | exit 0 887 | ;; 888 | --remove) 889 | remove_xray 890 | exit 0 891 | ;; 892 | *) 893 | print_error "The unknown argument" 894 | print_help 895 | exit 1 896 | ;; 897 | esac 898 | shift 899 | done 900 | 901 | print_help --------------------------------------------------------------------------------