From: dlezcano Date: Wed, 26 Nov 2008 17:36:54 +0000 (+0000) Subject: Make the script to call itself. X-Git-Tag: lxc_0_5_0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=078273d5df079e7844e983d3e566486cef63a0bd;p=thirdparty%2Flxc.git 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 --- 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