vpp-swan: Add scripts for testing
[vpp.git] / extras / strongswan / vpp_sswan / docker / exposedockernetns.sh
1 #!/bin/bash
2
3 if [ "$1" == "" ]; then
4         echo "usage: $0 <container_name>"
5         echo "Exposes the netns of a docker container to the host"
6         exit 1
7 fi
8
9         pid=`docker inspect -f '{{.State.Pid}}' $1`
10         ln -s /proc/$pid/ns/net /var/run/netns/$1
11
12         echo "netns of ${1} exposed as /var/run/netns/${1}"
13
14         #echo "try: ip netns exec ${1} ip addr list"