mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-12 08:21:40 +00:00
~添加ss和vmess入站支持
This commit is contained in:
50
scripts/libs/sb_endpoints.sh
Normal file
50
scripts/libs/sb_endpoints.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
[ "$ts_service" = ON ] && {
|
||||
[ "$ts_subnet" = true ] && advertise_routes='"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"'
|
||||
[ -z "$ts_exit_node" ] && ts_exit_node=false
|
||||
cat >"$TMPDIR"/jsons/tailscale.json <<EOF
|
||||
{
|
||||
"endpoints": [
|
||||
{
|
||||
"type": "tailscale",
|
||||
"tag": "ts-ep",
|
||||
"state_directory": "/tmp/ShellCrash/tailscale",
|
||||
"auth_key": "$ts_auth_key",
|
||||
"hostname": "ShellCrash-ts-ep",
|
||||
"advertise_routes": [$advertise_routes],
|
||||
"advertise_exit_node": $ts_exit_node,
|
||||
"udp_timeout": "5m"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
[ "$wg_service" = ON ] && {
|
||||
[ -n "$wg_ipv6" ] && wg_ipv6_add=", \"$wg_ipv6\""
|
||||
cat >"$TMPDIR"/jsons/wireguard.json <<EOF
|
||||
{
|
||||
"endpoints": [
|
||||
{
|
||||
"type": "wireguard",
|
||||
"tag": "wg-ep",
|
||||
"system": true,
|
||||
"mtu": 1420,
|
||||
"address": [ "$wg_ipv4"$wg_ipv6_add ],
|
||||
"private_key": "$wg_private_key",
|
||||
"peers": [
|
||||
{
|
||||
"address": "$wg_server",
|
||||
"port": $wg_port,
|
||||
"public_key": "$wg_public_key",
|
||||
"pre_shared_key": "$wg_pre_shared_key",
|
||||
"allowed_ips": ["0.0.0.0/0", "::/0"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user