summaryrefslogtreecommitdiffstats
path: root/bin/gen-ldif
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-07 14:59:28 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-07 14:59:28 +0000
commitd40895d9aa0a2d5cb89c6f96a7f4f4779ed08d63 (patch)
treefab4aa73e9226d9ab3103e065acbcd11c224c98d /bin/gen-ldif
parenta8c1bbcb6b20d60926be7b80dda0c6d77871b600 (diff)
downloadpykolab-d40895d9aa0a2d5cb89c6f96a7f4f4779ed08d63.tar.gz
Take options that modify which users end up where (domain name, rootdn and ou, in that order)
Diffstat (limited to 'bin/gen-ldif')
-rwxr-xr-xbin/gen-ldif8
1 files changed, 6 insertions, 2 deletions
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 ""