Merge glorytunctl with glorytun and use argz
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec glorytun "$@" \
|
||||
exec glorytun bind "$@" \
|
||||
${DEV:+dev "$DEV"} \
|
||||
${HOST:+host "$HOST"} \
|
||||
${PORT:+port "$PORT"} \
|
||||
${BIND:+bind "$BIND"} \
|
||||
${BIND_PORT:+bind-port "$BIND_PORT"}
|
||||
${HOST:+to "$HOST" "$PORT"} \
|
||||
${BIND_PORT:+port "$BIND_PORT"}
|
||||
|
||||
@@ -39,7 +39,7 @@ DEV=gt${HOST:+c}-$NAME
|
||||
HOST=$HOST
|
||||
PORT=$PORT
|
||||
BIND_PORT=$BIND_PORT
|
||||
OPTIONS=v4only mtu-auto
|
||||
OPTIONS=v4only mtu auto
|
||||
EOF
|
||||
|
||||
( umask 077; echo "$KEY" > "$DIR/key" )
|
||||
@@ -53,7 +53,7 @@ TABLE=200
|
||||
# keep the current route to HOST
|
||||
SRC=$(ip route get "$HOST" | awk '/src/{getline;print $0}' RS=' ')
|
||||
ip rule add from "$SRC" table main pref "$((PREF-1))" || true
|
||||
glorytunctl path add "$SRC" dev "$DEV"
|
||||
glorytun path up "$SRC" dev "$DEV"
|
||||
|
||||
# forward everything else to the tunnel
|
||||
ip rule add from all table "$TABLE" pref "$PREF" || true
|
||||
|
||||
Reference in New Issue
Block a user