Commit 677a76dd by Dark Templar Committed by Stéphane Graber

Make legacy lxc-ls more robust

Behave well when /etc/lxc/${name} is a symlink to directory Signed-off-by: 's avatarDark Templar <dark_templar@hotbox.ru> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 6abb0d4a
......@@ -86,7 +86,7 @@ done
containers=""
if [ ! -z "$directory" ]; 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
containers=$(find $directory -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:.*/::')
fi
......
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