mirror of
https://github.com/dadevel/wg-netns
synced 2024-10-30 21:20:12 +00:00
10 lines
238 B
Bash
Executable File
10 lines
238 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
if [ $# -ne 3 ]; then
|
|
echo 'usage: netns-publish PUBLIC_PORT NETNS_NAME NETNS_ADDRESS:NETNS_PORT'
|
|
exit 1
|
|
fi
|
|
|
|
exec socat tcp-listen:"$1",reuseaddr,fork "exec:ip netns exec $2 socat stdio 'tcp-connect:$3',nofork"
|