Changeset 2912

Show
Ignore:
Timestamp:
05/21/10 13:33:33
Author:
bleibson
Message:

o Another checkpoint. This one may actually be producing good ldif data.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/util/processLocationData.sh

    r2911 r2912  
    55# 
    66 
     7# field seperator used in input file 
    78FS='|' 
     9 
     10# input and output files 
    811INFILE=BerkeleyLocRecords.txt 
    9 LDAPOUT=ldapOut 
    10 VCARDOUT=vcardOut 
     12LDAPLOC=ldapLoc 
     13VCARDLOC=vcardLoc 
     14LDAPPEOPLE=ldapPeople 
     15VCARDPEOPLE=vcardPeople 
     16 
    1117LDAPSetLines="objectclass: top 
    1218objectclass: calendarresource 
    13 objectclass: admittanceinfo 
    14 objectclass: inventoryinfo 
    1519objectclass: schedapprovalinfo 
    16 objectclass: calendarresourcecost" 
     20objectclass: organizationalUnit" 
    1721VCARDHeader="BEGIN:VCARD 
    1822   VERSION:4.0" 
     
    2125uidSuffix="@berkeley.edu" 
    2226 
    23 cp /dev/null $LDAPOUT 
    24 cp /dev/null $VCARDOUT 
    25  
    26  
     27cp /dev/null $LDAPLOC 
     28cp /dev/null $VCARDLOC 
     29cp /dev/null $LDAPPEOPLE 
     30cp /dev/null $VCARDPEOPLE 
    2731 
    2832counter=0 
     
    4751        #F5 => first name of room manager 
    4852        F5=$(echo $line|cut -d $FS -f 5) 
    49         if [ $F5 != "" ]; then 
    50                 buildPersion="true" 
     53        if [ "$F5" != "" ]; then 
     54                buildPerson="true" 
    5155                roomManager=${F5}${F4} 
    5256    fi 
    5357        #F6 => phone number of room manager 
    5458        F6=$(echo $line|cut -d $FS -f 6) 
     59        contactPhone=$F6 
    5560        #F7 => fax number of room manager 
    5661        F7=$(echo $line|cut -d $FS -f 7) 
     62        contactFax=$F7 
    5763        #F8 => email of room manager 
    5864        F8=$(echo $line|cut -d $FS -f 8) 
     65        contactEmail=$F8 
    5966        #F9 =>  
    6067        F9=$(echo $line|cut -d $FS -f 9) 
     
    6370        F11=$(echo $line|cut -d $FS -f11) 
    6471        if [ "$F11" = "" ]; then 
    65           autoaccept=true 
     72          autoaccept=TRUE 
    6673        else 
    67           autoaccept=false 
     74          autoaccept=FALSE 
    6875        fi 
    6976        F12=$(echo $line|cut -d $FS -f12) 
     
    8390    # If no info on autoaccept, turn it on.      
    8491        if [ "$F12" = "" ]; then  
    85                 F12="true
     92                F12="TRUE
    8693        fi 
    8794         
     
    95102cn: $cn 
    96103ou: locations 
    97 description: $F1" >> $LDAPOUT 
     104description: $F1" >> $LDAPLOC 
    98105  if [ "$F3" != "" ]; then 
    99     echo "capacity: $F3" >> $LDAPOUT 
     106    echo "capacity: $F3" >> $LDAPLOC 
    100107  fi 
    101108  echo "autoaccept: $autoaccept 
    102 " >> $LDAPOUT 
     109" >> $LDAPLOC 
    103110 
    104111    #VCARD 
     
    112119   AUTOACCEPT: $autoaccept 
    113120$VCARDFooter 
    114 " >> $VCARDOUT 
     121" >> $VCARDLOC 
    115122 
    116   ### people 
     123### people 
    117124  if [ $buildPerson = "true" ]; then 
    118         name="$F" 
    119         echo "dn: cn=${roomManager}, ou=people,dc=berkeley,dc=edu        
     125        echo "dn: cn=${roomManager}, ou=people,dc=berkeley,dc=edu" >> $LDAPPEOPLE  
    120126  fi 
    121127