lxc-netstat: use posix shell instead of bash

- use case .. in instead of comparison with globs
- avoid 'local'

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Natanael Copa 2012-12-25 17:08:56 +01:00 committed by Stéphane Graber
parent 4785915a51
commit c44fc03789

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# #
# lxc: linux Container library # lxc: linux Container library
@ -32,8 +32,6 @@ help() {
get_parent_cgroup() get_parent_cgroup()
{ {
local hierarchies hierarchy fields subsystems init_cgroup mountpoint
parent_cgroup="" parent_cgroup=""
# Obtain a list of hierarchies that contain one or more subsystems # 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 # Return the absolute path to the containers' parent cgroup
# (do not append '/lxc' if the hierarchy contains the 'ns' subsystem) # (do not append '/lxc' if the hierarchy contains the 'ns' subsystem)
if [[ ",$subsystems," == *,ns,* ]]; then case ",$subsystems," in
parent_cgroup="${mountpoint}${init_cgroup%/}" *,ns,*) parent_cgroup="${mountpoint}${init_cgroup%/}";;
else *) parent_cgroup="${mountpoint}${init_cgroup%/}/lxc";;
parent_cgroup="${mountpoint}${init_cgroup%/}/lxc" esac
fi
break break
done done
} }