2
0
mirror of https://github.com/dadevel/wg-netns synced 2024-10-30 21:20:12 +00:00
wg-netns/extras/netns-publish.sh
2022-03-20 22:15:28 +01:00

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"