mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
Make legacy lxc-ls more robust
Behave well when /etc/lxc/${name} is a symlink to directory Signed-off-by: Dark Templar <dark_templar@hotbox.ru> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
145832ba8b
commit
bf1e863682
@ -86,7 +86,7 @@ done
|
|||||||
containers=""
|
containers=""
|
||||||
if [ ! -z "$directory" ]; then
|
if [ ! -z "$directory" ]; then
|
||||||
if [ x"$parent_cgroup" = x ]; then
|
if [ x"$parent_cgroup" = x ]; then
|
||||||
containers=$(find $directory -mindepth 2 -maxdepth 2 -name config -type f |awk -F "/" '{print $(NF-1)}')
|
containers=$(find -L $directory -mindepth 2 -maxdepth 2 -name config -type f |awk -F "/" '{print $(NF-1)}')
|
||||||
else
|
else
|
||||||
containers=$(find $directory -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:.*/::')
|
containers=$(find $directory -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:.*/::')
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user