From 9264deb90dbc4597a3ba3546957dd411af34bf98 Mon Sep 17 00:00:00 2001 From: "Andreas B. Mundt" Date: Mon, 26 Oct 2020 20:53:53 +0100 Subject: [PATCH] Better group handling with keyword 'none'. --- roles/ldap/templates/debian-lan.j2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/ldap/templates/debian-lan.j2 b/roles/ldap/templates/debian-lan.j2 index 5572869..dba9532 100644 --- a/roles/ldap/templates/debian-lan.j2 +++ b/roles/ldap/templates/debian-lan.j2 @@ -8,7 +8,8 @@ set -eu usage(){ cat < [] [] [] + $(basename $0) adduser |none + $(basename $0) adduser [] $(basename $0) deluser $(basename $0) delhost $(basename $0) ldapvi @@ -16,13 +17,13 @@ Usage: : User ID (login name) : Password - : If given, the user is added to this posix group (in addition to his personal group). - The group must already exist in the LDAP DT. + : If given and not "none", the user is added to this posix group (in addition to his + personal group). The group must already exist in the LDAP DT. , : LDAP attributes 'givenName' and 'sn'. If omitted, is used. : File containing lines of the form: - adduser [] [] [] - adduser [] [] [] + adduser + adduser … deluser deluser @@ -160,7 +161,7 @@ gidNumber: ${gidNumber} ################################## EOF - if [ -n "$grp" ] ; then + if [ -n "$grp" -a "$grp" != "none" ] ; then cat <