From 078273d5df079e7844e983d3e566486cef63a0bd Mon Sep 17 00:00:00 2001 From: dlezcano Date: Wed, 26 Nov 2008 17:36:54 +0000 Subject: [PATCH] Make the script to call itself. From: Daniel Lezcano 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 --- src/lxc/lxc-netstat.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in index 6603d4a20..0ccc1521a 100644 --- a/src/lxc/lxc-netstat.in +++ b/src/lxc/lxc-netstat.in @@ -3,6 +3,7 @@ prefix=@prefix@ lxcpath=@localstatedir@/lxc +exec="" if [ ! -r $lxcpath ]; then exit 0 @@ -17,9 +18,15 @@ for i in $*; do 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 " exit 1 -- 2.39.5