From b2aeceae9107462d9eebd1c1940a653fdbe55f87 Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Mon, 11 May 2015 10:18:27 +0200 Subject: [PATCH] minor optimisation ... --- cdist/conf/type/__user_groups/gencode-remote | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cdist/conf/type/__user_groups/gencode-remote b/cdist/conf/type/__user_groups/gencode-remote index 684e6ee7..65404bfc 100755 --- a/cdist/conf/type/__user_groups/gencode-remote +++ b/cdist/conf/type/__user_groups/gencode-remote @@ -23,11 +23,9 @@ state_should="$(cat "$__object/parameter/state")" oldusermod="$(cat "$__object/explorer/oldusermod")" if [ "$oldusermod" = "true" ]; then - old=yes addparam="-A" delparam="-R" else - old=no addparam="-a" delparam="-d" fi @@ -53,9 +51,9 @@ if [ -z "$changed_groups" ]; then fi for group in $changed_groups; do - if [ "$old" = "no" ]; then - echo "gpasswd $action \"$user\" \"$group\"" - else + if [ "$oldusermod" = "true" ]; then echo "usermod $action \"$group\" \"$user\"" + else + echo "gpasswd $action \"$user\" \"$group\"" fi done