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