Commit c44fc037 by Natanael Copa Committed by Stéphane Graber

lxc-netstat: use posix shell instead of bash

- use case .. in instead of comparison with globs - avoid 'local' Signed-off-by: 's avatarNatanael Copa <ncopa@alpinelinux.org> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 4785915a
#!/bin/bash
#!/bin/sh
#
# lxc: linux Container library
......@@ -32,8 +32,6 @@ help() {
get_parent_cgroup()
{
local hierarchies hierarchy fields subsystems init_cgroup mountpoint
parent_cgroup=""
# Obtain a list of hierarchies that contain one or more subsystems
......@@ -58,11 +56,10 @@ get_parent_cgroup()
# Return the absolute path to the containers' parent cgroup
# (do not append '/lxc' if the hierarchy contains the 'ns' subsystem)
if [[ ",$subsystems," == *,ns,* ]]; then
parent_cgroup="${mountpoint}${init_cgroup%/}"
else
parent_cgroup="${mountpoint}${init_cgroup%/}/lxc"
fi
case ",$subsystems," in
*,ns,*) parent_cgroup="${mountpoint}${init_cgroup%/}";;
*) parent_cgroup="${mountpoint}${init_cgroup%/}/lxc";;
esac
break
done
}
......
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