From b55ce704ea4b59c975013d8a7c387bec591e5548 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 12 Jan 2011 14:53:43 +0100 Subject: [PATCH] scripts: cgconfig, cleanup * get rid of some unneeded bashisms * remove unused variables Signed-off-by: Jiri Slaby Signed-off-by: Jan Safranek --- scripts/init.d/cgconfig.in | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in index 0b3afd29..00a1c9bc 100644 --- a/scripts/init.d/cgconfig.in +++ b/scripts/init.d/cgconfig.in @@ -32,13 +32,7 @@ # get correct location of binaries from configure prefix=@prefix@;exec_prefix=@exec_prefix@;sbindir=@sbindir@ CGCONFIGPARSER_BIN=$sbindir/cgconfigparser -CGROUP_FS=cgroup CONFIG_FILE=/etc/cgconfig.conf - -# support multiple mount points -declare -a MOUNTPOINT -declare -a MOUNTOPTS -maxindex=0 servicename=cgconfig # @@ -55,14 +49,12 @@ fi RETVAL=0 create_default_groups() { - declare defaultcgroup + defaultcgroup= - if [ -f /etc/cgrules.conf ] - then - read user ctrl defaultcgroup <<< \ - `grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf` - if [[ -n $defaultcgroup && $defaultcgroup = "*" ]] - then + if [ -f /etc/cgrules.conf ]; then + grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf | \ + read user ctrl defaultcgroup + if [ -n "$defaultcgroup" -a "$defaultcgroup" = "*" ]; then log_warning_msg "/etc/cgrules.conf incorrect" log_warning_msg "Overriding it" defaultcgroup= @@ -129,7 +121,7 @@ start() { fi fi - if [ $CREATE_DEFAULT == "yes" ]; then + if [ $CREATE_DEFAULT = "yes" ]; then create_default_groups fi -- 2.47.2