Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
65a2d6b2
Commit
65a2d6b2
authored
Mar 04, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-destroy: add --lxc-path argument
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
b858bedf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lxc-destroy.in
src/lxc/lxc-destroy.in
+13
-7
No files found.
src/lxc/lxc-destroy.in
View file @
65a2d6b2
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#
#
usage
()
{
usage
()
{
echo
"usage:
$(
basename
$0
)
-n NAME [-f]"
>
&2
echo
"usage:
$(
basename
$0
)
-n NAME [-f]
[-P lxcpath]
"
>
&2
}
}
help
()
{
help
()
{
...
@@ -35,8 +35,9 @@ help() {
...
@@ -35,8 +35,9 @@ help() {
echo
"Remove an existing container on the system."
>
&2
echo
"Remove an existing container on the system."
>
&2
echo
>
&2
echo
>
&2
echo
"Options:"
>
&2
echo
"Options:"
>
&2
echo
" -n NAME specify the name of the container"
>
&2
echo
" -n NAME specify the name of the container"
>
&2
echo
" -f stop the container if it is running (rather than abort)"
>
&2
echo
" -f stop the container if it is running (rather than abort)"
>
&2
echo
" -P lxcpath container is in specified lxcpath"
>
&2
}
}
usage_err
()
{
usage_err
()
{
...
@@ -67,6 +68,11 @@ while [ $# -gt 0 ]; do
...
@@ -67,6 +68,11 @@ while [ $# -gt 0 ]; do
lxc_name
=
$1
lxc_name
=
$1
shift
shift
;;
;;
-P
|
--lxcpath
)
optarg_check
"
$opt
"
"
$1
"
lxc_path
=
$1
shift
;;
-f
)
-f
)
force
=
1
force
=
1
;;
;;
...
@@ -104,12 +110,12 @@ if [ ! -d "$lxc_path/$lxc_name" ]; then
...
@@ -104,12 +110,12 @@ if [ ! -d "$lxc_path/$lxc_name" ]; then
fi
fi
# make sure the container is stopped
# make sure the container is stopped
if
!
lxc-info
-n
$lxc_name
--state-is
"STOPPED"
;
then
if
!
lxc-info
-n
$lxc_name
-
P
$lxc_path
-
-state-is
"STOPPED"
;
then
if
[
$force
-eq
1
]
;
then
if
[
$force
-eq
1
]
;
then
lxc-stop
-n
$lxc_name
lxc-stop
-
P
$lxc_path
-
n
$lxc_name
lxc-wait
-n
$lxc_name
-s
STOPPED
lxc-wait
-
P
$lxc_path
-
n
$lxc_name
-s
STOPPED
else
else
echo
"
$(
basename
$0
)
: '
$lxc_name
'
$(
lxc-info
-n
$lxc_name
-s
)
; aborted"
>
&2
echo
"
$(
basename
$0
)
: '
$lxc_name
'
$(
lxc-info
-
P
$lxc_path
-
n
$lxc_name
-s
)
; aborted"
>
&2
exit
1
exit
1
fi
fi
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment