Merge pull request #1 from 233boy/master

Master
pull/349/head
Daniel1107 6 years ago committed by GitHub
commit 2c94a2c796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 89
      config/client/h2.json
  2. 89
      config/client/http.json
  3. 89
      config/client/kcp.json
  4. 89
      config/client/quic.json
  5. 89
      config/client/tcp.json
  6. 89
      config/client/ws.json
  7. 89
      config/client/ws_tls.json
  8. 92
      install.sh
  9. 20
      src/bbr.sh
  10. 2
      src/client_file.sh
  11. 10
      src/download-caddy.sh
  12. 1
      src/download-v2ray.sh
  13. 6
      src/init.sh
  14. 2
      src/uninstall.sh
  15. 8
      src/vmess-config.sh
  16. 61
      v2ray.sh

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -39,32 +35,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -75,35 +105,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -69,32 +65,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -105,35 +135,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -40,32 +36,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -76,35 +106,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -39,32 +35,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -75,35 +105,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -29,32 +25,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -65,35 +95,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -32,32 +28,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -68,35 +98,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -1,8 +1,4 @@
{ {
"log": {
"error": "error.log",
"loglevel": "warning"
},
"outbounds": [ "outbounds": [
{ {
"protocol": "vmess", "protocol": "vmess",
@ -42,32 +38,66 @@
"protocol": "freedom", "protocol": "freedom",
"settings": {}, "settings": {},
"tag": "direct" "tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
},
{
"protocol": "dns",
"tag": "dns-out"
} }
], ],
"inbounds": [ "inbounds": [
{
"port": "1099",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"timeout": 0,
"followRedirect": true
}
},
{
"port": 2133,
"tag": "dns-in",
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 80,
"timeout": 0,
"network": "tcp,udp"
}
},
{ {
"port": 2333, "port": 2333,
"listen": "127.0.0.1",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
}, },
{ {
"port": 6666, "port": 6666,
"listen": "127.0.0.1",
"protocol": "http", "protocol": "http",
"settings": { "settings": {
"auth": "noauth", "auth": "noauth",
"udp": true, "udp": true
"ip": "127.0.0.1"
} }
} }
], ],
"dns": { "dns": {
"servers": [ "servers": [
"1.1.1.1",
"1.0.0.1",
{
"address": "119.29.29.29",
"port": 53,
"domains": [
"geosite:cn"
]
},
"8.8.8.8", "8.8.8.8",
"8.8.4.4", "8.8.4.4",
"localhost" "localhost"
@ -78,35 +108,30 @@
"rules": [ "rules": [
{ {
"type": "field", "type": "field",
"ip": [ "inboundTag": [
"0.0.0.0/8", "dns-in"
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10",
"geoip:cn"
], ],
"domain": [ "outboundTag": "dns-out"
"geosite:cn" },
{
"type": "field",
"ip": [
"geoip:private"
], ],
"outboundTag": "direct" "outboundTag": "blocked"
}, },
{ {
"type": "chinasites", "type": "field",
"ip": [
"geoip:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
}, },
{ {
"type": "chinaip", "type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct" "outboundTag": "direct"
} }
] ]

@ -6,6 +6,11 @@ yellow='\e[93m'
magenta='\e[95m' magenta='\e[95m'
cyan='\e[96m' cyan='\e[96m'
none='\e[0m' none='\e[0m'
_red() { echo -e ${red}$*${none}; }
_green() { echo -e ${green}$*${none}; }
_yellow() { echo -e ${yellow}$*${none}; }
_magenta() { echo -e ${magenta}$*${none}; }
_cyan() { echo -e ${cyan}$*${none}; }
# Root # Root
[[ $(id -u) != 0 ]] && echo -e "\n 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}\n" && exit 1 [[ $(id -u) != 0 ]] && echo -e "\n 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}\n" && exit 1
@ -14,22 +19,40 @@ cmd="apt-get"
sys_bit=$(uname -m) sys_bit=$(uname -m)
if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then case $sys_bit in
i[36]86)
v2ray_bit="32" v2ray_bit="32"
elif [[ $sys_bit == "x86_64" ]]; then caddy_arch="386"
;;
x86_64)
v2ray_bit="64" v2ray_bit="64"
else caddy_arch="amd64"
;;
*armv6*)
v2ray_bit="arm"
caddy_arch="arm6"
;;
*armv7*)
v2ray_bit="arm"
caddy_arch="arm7"
;;
*aarch64* | *armv8*)
v2ray_bit="arm64"
caddy_arch="arm64"
;;
*)
echo -e " echo -e "
哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none} 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}
备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统 备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
" && exit 1 " && exit 1
fi ;;
esac
# 笨笨的检测方法 # 笨笨的检测方法
if [[ -f /usr/bin/apt-get || -f /usr/bin/yum ]] && [[ -f /bin/systemctl ]]; then if [[ $(command -v apt-get) || $(command -v yum) ]] && [[ $(command -v systemctl) ]]; then
if [[ -f /usr/bin/yum ]]; then if [[ $(command -v yum) ]]; then
cmd="yum" cmd="yum"
@ -103,7 +126,32 @@ _load() {
local _dir="/etc/v2ray/233boy/v2ray/src/" local _dir="/etc/v2ray/233boy/v2ray/src/"
. "${_dir}$@" . "${_dir}$@"
} }
_sys_timezone() {
IS_OPENVZ=
if hostnamectl status | grep -q openvz; then
IS_OPENVZ=1
fi
echo
timedatectl set-timezone Asia/Shanghai
timedatectl set-ntp true
echo "已将你的主机设置为Asia/Shanghai时区并通过systemd-timesyncd自动同步时间。"
echo
if [[ $IS_OPENVZ ]]; then
echo
echo -e "你的主机环境为 ${yellow}Openvz${none} ,建议使用${yellow}v2ray mkcp${none}系列协议。"
echo -e "注意:${yellow}Openvz${none} 系统时间无法由虚拟机内程序控制同步。"
echo -e "如果主机时间跟实际相差${yellow}超过90秒${none},v2ray将无法正常通信,请发ticket联系vps主机商调整。"
fi
}
_sys_time() {
echo -e "\n主机时间:${yellow}"
timedatectl status | sed -n '1p;4p'
echo -e "${none}"
[[ $IS_OPENV ]] && pause
}
v2ray_config() { v2ray_config() {
# clear # clear
echo echo
@ -731,14 +779,16 @@ caddy_config() {
install_v2ray() { install_v2ray() {
$cmd update -y $cmd update -y
if [[ $cmd == "apt-get" ]]; then if [[ $cmd == "apt-get" ]]; then
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin $cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin dbus
else else
# $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services # $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap $cmd install -y lrzsz git zip unzip curl wget qrencode libcap
fi fi
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[ -d /etc/v2ray ] && rm -rf /etc/v2ray [ -d /etc/v2ray ] && rm -rf /etc/v2ray
date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z" # date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z"
_sys_timezone
_sys_time
if [[ $local_install ]]; then if [[ $local_install ]]; then
if [[ ! -d $(pwd)/config ]]; then if [[ ! -d $(pwd)/config ]]; then
@ -858,9 +908,9 @@ config() {
if [[ $cmd == "apt-get" ]]; then if [[ $cmd == "apt-get" ]]; then
cat >/etc/network/if-pre-up.d/iptables <<-EOF cat >/etc/network/if-pre-up.d/iptables <<-EOF
#!/bin/sh #!/bin/sh
/sbin/iptables-restore < /etc/iptables.rules.v4 /sbin/iptables-restore < /etc/iptables.rules.v4
/sbin/ip6tables-restore < /etc/iptables.rules.v6 /sbin/ip6tables-restore < /etc/iptables.rules.v6
EOF EOF
chmod +x /etc/network/if-pre-up.d/iptables chmod +x /etc/network/if-pre-up.d/iptables
# else # else
@ -907,20 +957,6 @@ backup_config() {
fi fi
} }
try_enable_bbr() {
if [[ $(uname -r | cut -b 1) -eq 4 ]]; then
case $(uname -r | cut -b 3-4) in
9. | [1-9][0-9])
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
sysctl -p >/dev/null 2>&1
;;
esac
fi
}
get_ip() { get_ip() {
ip=$(curl -s https://ipinfo.io/ip) ip=$(curl -s https://ipinfo.io/ip)
[[ -z $ip ]] && ip=$(curl -s https://api.ip.sb/ip) [[ -z $ip ]] && ip=$(curl -s https://api.ip.sb/ip)
@ -980,7 +1016,6 @@ install() {
blocked_hosts blocked_hosts
shadowsocks_config shadowsocks_config
install_info install_info
try_enable_bbr
# [[ $caddy ]] && domain_check # [[ $caddy ]] && domain_check
install_v2ray install_v2ray
if [[ $caddy || $v2ray_port == "80" ]]; then if [[ $caddy || $v2ray_port == "80" ]]; then
@ -993,6 +1028,11 @@ install() {
fi fi
fi fi
[[ $caddy ]] && install_caddy [[ $caddy ]] && install_caddy
## bbr
_load bbr.sh
_try_enable_bbr
get_ip get_ip
config config
show_config_info show_config_info

@ -0,0 +1,20 @@
_open_bbr() {
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
sysctl -p >/dev/null 2>&1
echo
_green "..由于你的 VPS 内核支持开启 BBR ...已经为你启用 BBR 优化...."
echo
}
_try_enable_bbr() {
local _test1=$(uname -r | cut -d\. -f1)
local _test2=$(uname -r | cut -d\. -f2)
if [[ $_test1 -eq 4 && $_test2 -ge 9 ]] || [[ $_test1 -ge 5 ]]; then
_open_bbr
enable_bbr=true
fi
}

@ -1,3 +1,5 @@
# vmess
_load vmess-config.sh
_get_client_file() { _get_client_file() {
local _link="$(cat $v2ray_client_config | tr -d [:space:] | base64 -w0)" local _link="$(cat $v2ray_client_config | tr -d [:space:] | base64 -w0)"
local link="https://233boy.github.io/tools/json.html#${_link}" local link="https://233boy.github.io/tools/json.html#${_link}"

@ -2,11 +2,7 @@ _download_caddy_file() {
caddy_tmp="/tmp/install_caddy/" caddy_tmp="/tmp/install_caddy/"
caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz" caddy_tmp_file="/tmp/install_caddy/caddy.tar.gz"
[[ -d $caddy_tmp ]] && rm -rf $caddy_tmp [[ -d $caddy_tmp ]] && rm -rf $caddy_tmp
if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal"
local caddy_download_link="https://caddyserver.com/download/linux/386?license=personal"
else
local caddy_download_link="https://caddyserver.com/download/linux/amd64?license=personal"
fi
mkdir -p $caddy_tmp mkdir -p $caddy_tmp
@ -27,6 +23,7 @@ _install_caddy_service() {
if [[ $systemd ]]; then if [[ $systemd ]]; then
cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/ cp -f ${caddy_tmp}init/linux-systemd/caddy.service /lib/systemd/system/
# sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service # sed -i "s/www-data/root/g" /lib/systemd/system/caddy.service
sed -i "/on-abnormal/a RestartSec=3" /lib/systemd/system/caddy.service
sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service sed -i "s/on-abnormal/always/" /lib/systemd/system/caddy.service
systemctl enable caddy systemctl enable caddy
else else
@ -44,4 +41,7 @@ _install_caddy_service() {
chown -R www-data.www-data /etc/ssl/caddy chown -R www-data.www-data /etc/ssl/caddy
mkdir -p /etc/caddy/ mkdir -p /etc/caddy/
## create sites dir
mkdir -p /etc/caddy/sites
} }

@ -30,6 +30,7 @@ _download_v2ray_file() {
mkdir -p /usr/bin/v2ray mkdir -p /usr/bin/v2ray
cp -f "/tmp/v2ray/v2ray" "/usr/bin/v2ray/v2ray" cp -f "/tmp/v2ray/v2ray" "/usr/bin/v2ray/v2ray"
chmod +x "/usr/bin/v2ray/v2ray" chmod +x "/usr/bin/v2ray/v2ray"
echo "alias v2ray=$_v2ray_sh" >>/root/.bashrc
cp -f "/tmp/v2ray/v2ctl" "/usr/bin/v2ray/v2ctl" cp -f "/tmp/v2ray/v2ctl" "/usr/bin/v2ray/v2ctl"
chmod +x "/usr/bin/v2ray/v2ctl" chmod +x "/usr/bin/v2ray/v2ctl"
} }

@ -1,3 +1,9 @@
_red() { echo -e ${red}$*${none}; }
_green() { echo -e ${green}$*${none}; }
_yellow() { echo -e ${yellow}$*${none}; }
_magenta() { echo -e ${magenta}$*${none}; }
_cyan() { echo -e ${cyan}$*${none}; }
_rm() { _rm() {
rm -rf "$@" rm -rf "$@"
} }

@ -86,6 +86,7 @@ if [[ $is_uninstall_v2ray && $is_uninstall_caddy ]]; then
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf $_v2ray_sh rm -rf $_v2ray_sh
sed -i '/alias v2ray=/d' /root/.bashrc
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
@ -148,6 +149,7 @@ elif [[ $is_uninstall_v2ray ]]; then
rm -rf /usr/bin/v2ray rm -rf /usr/bin/v2ray
rm -rf $_v2ray_sh rm -rf $_v2ray_sh
sed -i '/alias v2ray=/d' /root/.bashrc
rm -rf /etc/v2ray rm -rf /etc/v2ray
rm -rf /var/log/v2ray rm -rf /var/log/v2ray
if [[ $systemd ]]; then if [[ $systemd ]]; then

@ -98,14 +98,14 @@ esac
## change client config file ## change client config file
[[ -z $ip ]] && get_ip [[ -z $ip ]] && get_ip
if [[ $v2ray_transport == [45] ]]; then if [[ $v2ray_transport == [45] ]]; then
sed -i "s/233blog.com/$domain/; 13s/2333/443/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config sed -i "s/233blog.com/$domain/; 9s/2333/443/; 12s/$old_id/$v2ray_id/; 13s/233/$alterId/" $v2ray_client_config
if [[ $is_path ]]; then if [[ $is_path ]]; then
sed -i "31s/233blog/$path/" $v2ray_client_config sed -i "27s/233blog/$path/" $v2ray_client_config
else else
sed -i "31s/233blog//" $v2ray_client_config sed -i "27s/233blog//" $v2ray_client_config
fi fi
else else
sed -i "s/233blog.com/$ip/; 13s/2333/$v2ray_port/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config sed -i "s/233blog.com/$ip/; 9s/2333/$v2ray_port/; 12s/$old_id/$v2ray_id/; 13s/233/$alterId/" $v2ray_client_config
fi fi
# zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config # zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config

@ -10,21 +10,43 @@ none='\e[0m'
# Root # Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v3.09" _version="v3.13"
cmd="apt-get" cmd="apt-get"
sys_bit=$(uname -m) sys_bit=$(uname -m)
if [[ $sys_bit == "i386" || $sys_bit == "i686" ]]; then case $sys_bit in
i[36]86)
v2ray_bit="32" v2ray_bit="32"
elif [[ $sys_bit == "x86_64" ]]; then caddy_arch="386"
;;
x86_64)
v2ray_bit="64" v2ray_bit="64"
else caddy_arch="amd64"
echo -e " 哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}" && exit 1 ;;
fi *armv6*)
v2ray_bit="arm"
caddy_arch="arm6"
;;
*armv7*)
v2ray_bit="arm"
caddy_arch="arm7"
;;
*aarch64* | *armv8*)
v2ray_bit="arm64"
caddy_arch="arm64"
;;
*)
echo -e "
哈哈……这个 ${red}辣鸡脚本${none} 不支持你的系统。 ${yellow}(-_-) ${none}
备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
" && exit 1
;;
esac
if [[ -f /usr/bin/yum ]]; then if [[ $(command -v yum) ]]; then
cmd="yum" cmd="yum"
@ -2293,33 +2315,14 @@ other() {
install_bbr() { install_bbr() {
local test1=$(sed -n '/net.ipv4.tcp_congestion_control/p' /etc/sysctl.conf) local test1=$(sed -n '/net.ipv4.tcp_congestion_control/p' /etc/sysctl.conf)
local test2=$(sed -n '/net.core.default_qdisc/p' /etc/sysctl.conf) local test2=$(sed -n '/net.core.default_qdisc/p' /etc/sysctl.conf)
if [[ $(uname -r | cut -b 1) -eq 4 ]]; then
case $(uname -r | cut -b 3-4) in
9. | [1-9][0-9])
if [[ $test1 == "net.ipv4.tcp_congestion_control = bbr" && $test2 == "net.core.default_qdisc = fq" ]]; then if [[ $test1 == "net.ipv4.tcp_congestion_control = bbr" && $test2 == "net.core.default_qdisc = fq" ]]; then
local is_bbr=true
else
local try_enable_bbr=true
fi
;;
esac
fi
if [[ $is_bbr ]]; then
echo echo
echo -e "$green BBR 已经启用啦...无需再安装$none" echo -e "$green BBR 已经启用啦...无需再安装$none"
echo echo
elif [[ $try_enable_bbr ]]; then
sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.conf
echo "net.core.default_qdisc = fq" >>/etc/sysctl.conf
sysctl -p >/dev/null 2>&1
echo
echo -e "$green ..由于你的 VPS 内核支持开启 BBR ...已经为你启用 BBR 优化....$none"
echo
else else
# https://teddysun.com/489.html _load bbr.sh
bash <(curl -s -L https://github.com/teddysun/across/raw/master/bbr.sh) _try_enable_bbr
[[ ! $enable_bbr ]] && bash <(curl -s -L https://github.com/teddysun/across/raw/master/bbr.sh)
fi fi
} }
install_lotserver() { install_lotserver() {

Loading…
Cancel
Save