123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #!/bin/bash
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
- export PATH
- #rm -rf $0
- #https://github.com/v2fly/v2ray-core/releases/download/v5.0.8/v2ray-linux-64.zip
- #https://github.com/v2fly/v2ray-core/releases/download/v4.34.0/v2ray-linux-64.zip
- #https://jihulab.com/hepingcaizi/sao/-/raw/main/v2ray/v4.34.0/v2ray-linux-64.zip
- #删除代码
- #bash install-release.sh --remove
- #卸载#########
- systemctl stop v2ray #停止
- systemctl disable v2ray
- rm -rf /root/v2
- rm -rf /var/log/v2ray/ /usr/local/etc/v2ray
- rm -rf /usr/local/bin/v2ray /usr/local/share/v2ray
- rm -rf /etc/systemd/system/v2ray.service /etc/systemd/system/v2ray@.service
- rm -rf /etc/systemd/system/v2ray.service.d /etc/systemd/system/v2ray@.service.d
- ###############
- mkdir -p /root/v2
- cd /root/v2
- wget https://jihulab.com/hepingcaizi/sao/-/raw/main/v2ray/install-release.sh -O install-release.sh
- wget https://jihulab.com/hepingcaizi/sao/-/raw/main/v2ray/v5.1.0/v2ray-linux-64.zip -O v2ray-linux-64.zip
- chmod +x install-release.sh
- clear
- printf "\033c"
- # 1、切换至你的上传目录
- #cd /root/v2
- # 2、指定包执行安装
- echo -e "\033[31m
- 如确认无误,请按任意键继…………\033[0m "+
- ./install-release.sh -l ./v2ray-linux-64.zip > /dev/null 2>&1
- rm -rf /root/v2
- #设置开机自启:
- systemctl enable v2ray
- systemctl restart v2ray
- clear
- printf "\033c"
- sleep 0.1
- #修改配置,重新启动
- rm -rf /usr/local/etc/v2ray/config.json
- cat >/usr/local/etc/v2ray/config.json <<-EOF
- {
- "log": {
- "access": "/var/log/v2ray/access.log",
- "error": "/var/log/v2ray/error.log",
- "loglevel": "warning"
- },
- "inbounds": [{
- "port": 5566,
- "protocol": "vmess",
- "settings": {
- "clients": [{
- "id": "54f0f20d-7ff9-4dbd-ada0-fa1e27622d85",
- "level": 1,
- "alterId": 0
- }
- ]
- },
- "streamSettings": {
- "network": "ws",
- "wsSettings": {
- "path": "/"
- }
- }
- }
- ],
- "outbounds": [{
- "protocol": "freedom"
- }
- ]
- }
- EOF
-
- systemctl restart v2ray
- sleep 0.1
- systemctl status v2ray
- ##显示
- echo "-------------------------------------------
- #启动代码:
- systemctl start v2ray #启动
- systemctl stopt v2ray #停止
- systemctl restart v2ray #重启
- systemctl status v2ray #检测
- -------------------------------------------
- "
- #配置查看:
- echo "
- 配置查看代码:cat /usr/local/etc/v2ray/config.json
- id: "54f0f20d-7ff9-4dbd-ada0-fa1e27622d85"
- 端口:5566
- 传输协议:ws
- "alterId": 0
- vmess://eyJhZGQiOiIxMjQuMjIzLjExMS4xMzQiLCJhaWQiOiIwIiwiaG9zdCI6IndhcHBheS4xODkuY24iLCJpZCI6IjU0ZjBmMjBkLTdmZjktNGRiZC1hZGEwLWZhMWUyNzYyMmQ4NSIsIm5ldCI6IndzIiwicGF0aCI6IiIsInBvcnQiOiI1NTY2IiwicHMiOiJhIiwic2N5Ijoibm9uZSIsInNuaSI6IiIsInRscyI6IiIsInR5cGUiOiIiLCJ2IjoiMiJ9
- ---------------------------------"
|