use keyword for sed

pull/149/head
BOYPT 6 years ago committed by cutelua
parent 807eba6974
commit 538672319c
  1. 12
      config/client/h2.json
  2. 8
      config/client/http.json
  3. 8
      config/client/kcp.json
  4. 8
      config/client/quic.json
  5. 8
      config/client/tcp.json
  6. 8
      config/client/ws.json
  7. 8
      config/client/ws_tls.json
  8. 6
      config/server/dynamic/http.json
  9. 6
      config/server/dynamic/kcp.json
  10. 6
      config/server/dynamic/quic.json
  11. 6
      config/server/dynamic/tcp.json
  12. 6
      config/server/dynamic/ws.json
  13. 6
      config/server/h2.json
  14. 6
      config/server/http.json
  15. 6
      config/server/kcp.json
  16. 6
      config/server/quic.json
  17. 6
      config/server/tcp.json
  18. 6
      config/server/ws.json
  19. 17
      src/vmess-config.sh

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]
@ -26,9 +26,9 @@
"security": "tls",
"httpSettings": {
"host": [
"233blog.com"
"##H2DOMAIN##"
],
"path": "/233blog"
"path": "##H2PATH##"
}
},
"mux": {

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -9,12 +9,12 @@
"settings": {
"vnext": [
{
"address": "233blog.com",
"port": 2333,
"address": "##VMADDR##",
"port": ##VMPORT##,
"users": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"alterId": 233,
"id": "##VMUSERID##",
"alterId": ##VMALTID##,
"security": "auto"
}
]

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
],
"detour": {

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
],
"detour": {

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
],
"detour": {

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
],
"detour": {

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
],
"detour": {

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -41,14 +41,14 @@
},
{
"tag": "vmess-in",
"port": 2333,
"port": ##VMPORT##,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e55c8d17-2cf3-b21a-bcf1-eeacb011ed79",
"id": "##VMUSERID##",
"level": 1,
"alterId": 233
"alterId": ##VMALTID##
}
]
},

@ -55,7 +55,7 @@ cp -f $v2ray_server_config_file $v2ray_server_config
cp -f $v2ray_client_config_file $v2ray_client_config
# change port, uuid, alterId
sed -i "9s/2333/$v2ray_port/; 14s/$old_id/$v2ray_id/; 16s/233/$alterId/" $v2ray_server_config
sed -i "s/##VMPORT##/$v2ray_port/; s/##VMUSERID##/$v2ray_id/; s/##VMALTID##/$alterId/" $v2ray_server_config
# change dynamic port
if [[ $v2ray_transport -ge 18 ]]; then
@ -66,11 +66,11 @@ fi
# change domain and path, or header type
case $v2ray_transport in
5)
sed -i "24s/233blog.com/$domain/" $v2ray_server_config
sed -i "s/##H2DOMAIN##/$domain/" $v2ray_server_config
if [[ $is_path ]]; then
sed -i "26s/233blog/$path/" $v2ray_server_config
sed -i "s/##H2PATH##/$path/" $v2ray_server_config
else
sed -i "26s/233blog//" $v2ray_server_config
sed -i "s/##H2PATH##//" $v2ray_server_config
fi
;;
7 | 13 | 22 | 28)
@ -97,15 +97,14 @@ esac
## change client config file
[[ -z $ip ]] && get_ip
sed -i "s/##VMADDR##/$ip/; s/##VMPORT##/$v2ray_port/; s/##VMUSERID##/$v2ray_id/; s/##VMALTID##/$alterId/" $v2ray_client_config
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/##H2DOMAIN##/$domain/" $v2ray_client_config
if [[ $is_path ]]; then
sed -i "31s/233blog/$path/" $v2ray_client_config
sed -i "s/##H2PATH##/$path/" $v2ray_client_config
else
sed -i "31s/233blog//" $v2ray_client_config
sed -i "s/##H2PATH##//" $v2ray_client_config
fi
else
sed -i "s/233blog.com/$ip/; 13s/2333/$v2ray_port/; 16s/$old_id/$v2ray_id/; 17s/233/$alterId/" $v2ray_client_config
fi
# zip -q -r -j --password "233blog.com" /etc/v2ray/233blog_v2ray.zip $v2ray_client_config

Loading…
Cancel
Save