Commit d72d3d7b by Michel Normand Committed by Daniel Lezcano

lxc: add usage and help to lxc-netstat (V2)

parent b89885d8
#!/bin/bash #!/bin/bash
# set -ex # set -ex
usage() {
echo "usage: $(basename $0) --name <name> [netstat options]"
}
help() {
usage
echo
echo "execute netstat for the specified container"
echo "with the added netstat options"
echo
echo "Options:"
echo "name : name of the container"
echo "help : this current help."
echo
echo "to be executed as root."
}
exec="" exec=""
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "usage: $0 -n <name>" usage
exit 1 exit 1
fi fi
for i in $*; do for i in $*; do
case $i in case $i in
-n) -h|--help)
name=$2; shift 2;; help; exit 1;;
--exec) -n|--name)
exec="exec"; shift;; name=$2; shift 2;;
esac --exec)
exec="exec"; shift;;
esac
done done
if [ -z "$exec" ]; then if [ -z "$exec" ]; then
...@@ -22,8 +41,8 @@ if [ -z "$exec" ]; then ...@@ -22,8 +41,8 @@ if [ -z "$exec" ]; then
fi fi
if [ -z "$name" ]; then if [ -z "$name" ]; then
echo "usage: $0 -n <name>" usage
exit 1 exit 1
fi fi
cgroups=$(mount -l -t cgroup) cgroups=$(mount -l -t cgroup)
......
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