From d40895d9aa0a2d5cb89c6f96a7f4f4779ed08d63 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" Date: Mon, 7 Mar 2011 14:59:28 +0000 Subject: Take options that modify which users end up where (domain name, rootdn and ou, in that order) --- bin/gen-ldif | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/gen-ldif') diff --git a/bin/gen-ldif b/bin/gen-ldif index 33442e8..e4a3633 100755 --- a/bin/gen-ldif +++ b/bin/gen-ldif @@ -1,5 +1,9 @@ #!/bin/bash +[ ! -z "$2" ] && domain=$2 || domain="kanarip.com" +[ ! -z "$3" ] && rootdn=$3 || rootdn="dc=kanarip,dc=com" +[ ! -z "$4" ] && ou=$4 || ou="ou=People" + i=0 while [ $i -lt 0$1 ]; do @@ -13,7 +17,7 @@ while [ $i -lt 0$1 ]; do userpassword="VerySecret" - echo "dn: uid=$uid,ou=People,dc=kanarip,dc=com" + echo "dn: uid=$uid,${ou},${rootdn}" echo "uid: $uid" echo "givenName: $givenname" echo "objectClass: top" @@ -22,7 +26,7 @@ while [ $i -lt 0$1 ]; do echo "objectClass: organizationalPerson" echo "sn: $surname" echo "cn: $givenname $surname" - echo "mail: $uid@kanarip.com" + echo "mail: $uid@${domain}" echo "userPassword: {SSHA}zJ3oU5kqtS3MxnLWmKpnE7+eGVbmQKmj" echo "" -- cgit v1.1