]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Make the script to call itself.
authordlezcano <dlezcano>
Wed, 26 Nov 2008 17:36:54 +0000 (17:36 +0000)
committerdlezcano <dlezcano>
Wed, 26 Nov 2008 17:36:54 +0000 (17:36 +0000)
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>
src/lxc/lxc-netstat.in

index 6603d4a20c304f36147955786807bc06217cfc89..0ccc1521a0900554d2de3c873c0ac1a7d2859764 100644 (file)
@@ -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 <name>"
     exit 1