From: Daniel Lezcano <dlezcano@fr.ibm.com>
Make the script to call itself, so we can unshare the mount points safely,
they will be automatically unmounted when the command finish.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
prefix=@prefix@
lxcpath=@localstatedir@/lxc
+exec=""
if [ ! -r $lxcpath ]; then
exit 0
case $i in
-n)
name=$2; shift 2;;
+ --exec)
+ exec="exec"; shift;;
esac
done
+if [ -z "$exec" ]; then
+ exec @bindir@/lxc-unshare -m -- @bindir@/lxc-netstat -n $name --exec $*
+fi
+
if [ -z "$name" ]; then
echo "usage: $0 -n <name>"
exit 1