Initial commit

This commit is contained in:
Benjamin Collet 2018-04-07 21:40:38 +02:00
commit 35f2972e98
5 changed files with 90 additions and 0 deletions
if-down.d

15
if-down.d/netns Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
set -e
if [ -n "${IF_NETNS}" ]
then
unshare -m /bin/sh <<-EOF
mount --make-rprivate /
mount --bind /run/network.${IF_NETNS} /run/network
if (ip netns exec ${IF_NETNS} ifquery --list | grep -qx ${IFACE}); then
ip netns exec ${IF_NETNS} ifdown ${IFACE}
fi
ip netns exec ${IF_NETNS} ip link set netns 1 dev ${IFACE}
EOF
fi