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
7c7ec7a8
Commit
7c7ec7a8
authored
May 03, 2013
by
Harald Dunkel
Committed by
Serge Hallyn
May 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support alternate container path in lxc-netstat.in
Signed-off-by:
Harald Dunkel
<
harald.dunkel@aixigo.de
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
8ee3042a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
lxc-netstat.in
src/lxc/lxc-netstat.in
+16
-5
No files found.
src/lxc/lxc-netstat.in
View file @
7c7ec7a8
...
...
@@ -17,8 +17,10 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
.
@DATADIR@/lxc/lxc.functions
usage
()
{
echo
"usage:
$(
basename
$0
)
-n|--name <name> -- [netstat_options]"
>
&2
echo
"usage:
$(
basename
$0
)
-n|--name <name>
[-P|--lxcpath <lxc_path>]
-- [netstat_options]"
>
&2
}
help
()
{
...
...
@@ -26,8 +28,9 @@ help() {
echo
>
&2
echo
"Execute 'netstat' for the specified container."
>
&2
echo
>
&2
echo
" --name NAME specify the container name"
>
&2
echo
" NETSTAT_OPTIONS netstat command options (see
\`
netstat --help')"
>
&2
echo
" --name NAME specify the container name"
>
&2
echo
" --lxcpath LXC_PATH use an alternate container path"
>
&2
echo
" NETSTAT_OPTIONS netstat command options (see
\`
netstat --help')"
>
&2
}
get_parent_cgroup
()
...
...
@@ -73,6 +76,8 @@ while true; do
help
;
exit
1
;;
-n
|
--name
)
name
=
$2
;
shift
2
;;
-P
|
--lxcpath
)
lxc_path
=
"
$2
"
;
shift
2
;;
--exec
)
exec
=
"exec"
;
shift
;;
--
)
...
...
@@ -92,11 +97,17 @@ if [ -z "$name" ]; then
exit
1
fi
if
[
-z
"
$lxc_path
"
]
;
then
echo
"
$(
basename
$0
)
: no configuration path defined"
>
&2
usage
exit
1
fi
if
[
-z
"
$exec
"
]
;
then
exec
@BINDIR@/lxc-unshare
-s
MOUNT
--
$0
-n
$name
--exec
"
$@
"
exec
@BINDIR@/lxc-unshare
-s
MOUNT
--
$0
-n
$name
-
P
"
$lxc_path
"
-
-exec
"
$@
"
fi
if
lxc-info
-n
$name
--state-is
'STOPPED'
;
then
if
lxc-info
-n
$name
-
P
"
$lxc_path
"
-
-state-is
'STOPPED'
;
then
echo
"
$(
basename
$0
)
: container '
$name
' is not running"
>
&2
exit
1
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