new feature: site-to-site

fix #5
This commit is contained in:
asvow
2024-05-29 21:16:15 +08:00
parent 990ebc9d27
commit f97a9ed158
5 changed files with 66 additions and 34 deletions

View File

@@ -20,7 +20,7 @@ section_enabled() {
custom_instance() {
local cfg="$1"
local acceptRoutes hostname acceptDNS advertiseExitNode advertiseRoutes loginServer authkey std_out std_err
local acceptRoutes hostname acceptDNS advertiseExitNode s2s advertiseRoutes loginServer authkey std_out std_err
local ARGS=" up --reset"
if ! section_enabled "$cfg"; then
@@ -32,6 +32,7 @@ custom_instance() {
config_get hostname $cfg 'hostname'
config_get_bool acceptDNS $cfg 'acceptDNS'
config_get_bool advertiseExitNode $cfg 'advertiseExitNode'
config_get_bool s2s $cfg 's2s'
config_get advertiseRoutes $cfg 'advertiseRoutes'
config_get loginServer $cfg 'loginServer'
config_get authkey $cfg 'authkey'
@@ -42,6 +43,7 @@ custom_instance() {
[ -n "$hostname" ] && ARGS="$ARGS --hostname=$hostname"
[ "$acceptDNS" = "0" ] && ARGS="$ARGS --accept-dns=false"
[ "$advertiseExitNode" = "1" ] && ARGS="$ARGS --advertise-exit-node"
[ "$s2s" = "1" ] && ARGS="$ARGS --snat-subnet-routes=false --stateful-filtering=false"
[ -n "$advertiseRoutes" ] && ARGS="$ARGS --advertise-routes=$advertiseRoutes"
[ -n "$loginServer" ] && ARGS="$ARGS --login-server=$loginServer"
[ -n "$authkey" ] && ARGS="$ARGS --authkey=$authkey"