]>
Commit | Line | Data |
---|---|---|
4d17bf40 JR |
1 | Try adding the top-level object, which may be missing, but don't worry if |
2 | the add operation fails. | |
3 | --- MigrationTools-26/migrate_all_online.sh Wed Oct 25 16:27:02 2000 | |
4 | +++ MigrationTools-26/migrate_all_online.sh Wed Oct 25 16:30:11 2000 | |
5 | @@ -179,5 +179,30 @@ | |
6 | echo "Migrating netgroups (by host)..." | |
7 | $PERL -I${INSTDIR} ${INSTDIR}migrate_netgroup_byhost.pl $ETC_NETGROUP >> $DB | |
8 | ||
9 | +# Try to add the top-level object, because it's usually missing. | |
10 | +TYPE=`echo $LDAP_BASEDN | cut -f1 -d=` | |
11 | +TOP=`echo $LDAP_BASEDN | cut -f1 -d, | cut -f2 -d=` | |
12 | +CLASS=$TYPE | |
13 | +if [ "$CLASS" = "dc" ] ; then | |
14 | + CLASS=domain | |
15 | +elif [ "$CLASS" = "o" ] ; then | |
16 | + CLASS=organization | |
17 | +elif [ "$CLASS" = "l" ] ; then | |
18 | + CLASS=locality | |
19 | +elif [ "$CLASS" = "c" ] ; then | |
20 | + CLASS=country | |
21 | +elif [ "$CLASS" = "nismapname" ] ; then | |
22 | + CLASS=nisMap | |
23 | +elif [ "$CLASS" = "cn" ] ; then | |
24 | + CLASS=container | |
25 | +fi | |
26 | + | |
27 | +cat << EOF | $LDAPADD -h $LDAPHOST -D "$LDAP_BINDDN" -x -w "$LDAP_BINDCRED" | |
28 | +dn: $LDAP_BASEDN | |
29 | +$TYPE: $TOP | |
30 | +objectClass: top | |
31 | +objectClass: $CLASS | |
32 | +EOF | |
33 | + | |
34 | echo "Importing into LDAP..." | |
35 |