summaryrefslogtreecommitdiff
path: root/hosted-kolab/13-add-hosted-domain-with-external-ldap.sh
blob: 010979241e069a8d41956d1d0792b834ddd60e53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

 . ./settings.sh

if [ $# -ne 1 ]; then
    read -p "Domain name space: " $domain_name_space
else
    domain_name_space=$1
fi

(
    echo "dn: associateddomain=${domain_name_space},cn=kolab,cn=config"
    echo "objectclass: top"
    echo "objectclass: domainrelatedobject"
    echo "associateddomain: ${domain_name_space}"
    if [ ! -z "$2" ]; then
        echo "inetdomainbasedn: $2"
    fi
    echo ""
) | ldapadd -x -h ${ldap_host} -D "${ldap_binddn}" -w "${ldap_bindpw}"