]>
Commit | Line | Data |
---|---|---|
5e97c3fc | 1 | #!/bin/bash |
5c488699 | 2 | # set -ex |
6f8db460 | 3 | |
4 | prefix=@prefix@ | |
5 | lxcpath=@localstatedir@/lxc | |
5e97c3fc | 6 | |
5c488699 | 7 | if [ ! -r $lxcpath ]; then |
5e97c3fc | 8 | exit 0 |
9 | fi | |
10 | ||
5c488699 | 11 | if [ $# -eq 0 ]; then |
12 | echo "usage: $0 -n <name>" | |
13 | exit 1 | |
14 | fi | |
5e97c3fc | 15 | |
5c488699 | 16 | for i in $*; do |
17 | case $i in | |
18 | -n) | |
19 | name=$2; shift 2;; | |
20 | esac | |
5e97c3fc | 21 | done |
22 | ||
5c488699 | 23 | if [ -z "$name" ]; then |
24 | echo "usage: $0 -n <name>" | |
25 | exit 1 | |
26 | fi | |
27 | ||
28 | if [ ! -d $lxcpath/$name ]; then | |
29 | echo "'$name' does not exists" | |
30 | exit 1 | |
31 | fi | |
32 | ||
526e288e | 33 | if [ ! -r $lxcpath/$name ]; then |
34 | echo "Can not access '$name', permission denied" | |
35 | exit 1 | |
36 | fi | |
37 | ||
5c488699 | 38 | if [ -h $lxcpath/$name/nsgroup ]; then |
39 | ps $* -p $(cat $lxcpath/$name/nsgroup/tasks) | |
40 | fi | |
41 |