Commit 4a311c12 by Serge Hallyn Committed by Stéphane Graber

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.
parent 4d5fb23a
...@@ -136,6 +136,18 @@ while true; do ...@@ -136,6 +136,18 @@ while true; do
esac esac
done 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 if [ -z "$lxc_path" ]; then
echo "$(basename $0): no configuration path defined" >&2 echo "$(basename $0): no configuration path defined" >&2
exit 1 exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment