~ubuntu-branches/ubuntu/oneiric/lxc/oneiric-201108112013

« back to all changes in this revision

Viewing changes to src/lxc/lxc-create.in

  • Committer: Stéphane Graber
  • Date: 2011-08-11 18:43:59 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: stgraber@ubuntu.com-20110811184359-lkqgeuimw8n5efzj
Merge 0.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
22
 
23
23
usage() {
24
 
    echo "usage: lxc-create -n <name> [-f configuration] [-t template] [-h]"
 
24
    echo "usage: lxc-create -n <name> [-f configuration] [-t template] [-h] -- [template_options]"
25
25
}
26
26
 
27
27
help() {
33
33
    echo "name         : name of the container"
34
34
    echo "configuration: lxc configuration"
35
35
    echo "template     : lxc-template is an accessible template script"
 
36
    if [ -z $lxc_template ]; then
 
37
        echo "for template-specific help, specify a template, for instance:"
 
38
        echo "lxc-create -t ubuntu -h"
 
39
        exit 0
 
40
    fi
 
41
    type ${templatedir}/lxc-$lxc_template >/dev/null
 
42
    echo
 
43
    echo "template-specific help follows: (these options follow '--')"
 
44
    if [ $? -eq 0 ]; then
 
45
        ${templatedir}/lxc-$lxc_template -h
 
46
    fi
36
47
}
37
48
 
38
49
shortoptions='hn:f:t:'
162
173
        read dummy
163
174
    fi
164
175
 
165
 
    ${templatedir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name
 
176
    ${templatedir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name $*
166
177
    if [ $? -ne 0 ]; then
167
178
        echo "failed to execute template '$lxc_template'"
168
179
        ${bindir}/lxc-destroy -n $lxc_name