From: Serge Hallyn Date: Fri, 17 Aug 2012 02:11:50 +0000 (-0500) Subject: Cleanup partial container if -h was passed to template X-Git-Tag: lxc-2.1.1~2561^2~44 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=sidebyside;h=4a311c1241805dac5893918854fd40f77b2b6f49;p=mirror_lxc.git Cleanup partial container if -h was passed to template If user calls 'lxc-create -t ubuntu -- -h' (as opposed to 'lxc-create -t ubuntu -h') then the ubuntu template will print its help then exit 0. Then lxc-create does not cleanup. So detect this in lxc-create. --- diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in index 39d6f5475..cca415730 100644 --- a/src/lxc/lxc-create.in +++ b/src/lxc/lxc-create.in @@ -136,6 +136,18 @@ while true; do esac done +# If -h or --help was passed into the container, we'll want to cleanup +# afterward +wantedhelp=0 +for var in "$@" +do +if [ "$var" = "-h" -o "$var" = "--help" ]; then + help + exit 1 +fi +done + + if [ -z "$lxc_path" ]; then echo "$(basename $0): no configuration path defined" >&2 exit 1