Ignore:
Timestamp:
09/05/09 09:14:45 (15 years ago)
Author:
weill
Message:

arrivaldate and expiredate correction + test base

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/addon-shell/epo2db.sh

    r409 r427  
    1 exec < ~/epo-base.txt 
     1#!/bin/sh 
     2# $1 base epo  
     3if [ $# -ne 1 ] 
     4then  
     5  FIC=~/epo-base.txt     
     6elif [ -r $1 ] 
     7then 
     8  FIC=$1 
     9else 
     10  echo no file found  
     11  exit 1 
     12fi 
     13exec < $FIC 
    214while read A B C D E F G H I J K L M N O P Q R S T U V W X  
    315do 
     
    1123        NickName=$(echo $K |sed -e 's/NICK//' -e 's/zzz//' ) 
    1224        ArrivalDate=$(echo $L |sed -e 's/A//') 
    13  
     25        if [ $ArrivalDate -eq 19500101 ] 
     26        then  
     27                ArrivalDate="" 
     28        fi       
    1429        BirthDate=$(echo $N |sed -e 's/N//') 
    1530        ExpireDate=$(echo $M |sed -e 's/T//') 
     31        if [ $ExpireDate -eq 29990131 ] 
     32        then  
     33                ExpireDate="" 
     34        fi       
    1635        Departement="$(echo $P|sed -e 's/DOM/ /g')" 
    1736        # Gestion Votant 
     
    6786# Do the Stuff   
    6887        cat  <<EOF > /tmp/$$ 
    69         sn: "$Nom" 
    70         givenName: "$Prenom" 
     88        sn: $Nom 
     89        givenName: $Prenom 
    7190        initials: $NickName 
    7291        mail: $MailAddr 
     
    8099        contratType: $ContratType 
    81100EOF 
    82 cat /tmp/$$ | ssh -x root@ldap /usr/local/bin/latmosedit -f - $Login 
    83 ssh -x -f -n root@ldap /usr/local/bin/latmosguser $Login $Statut $Vote $Status $Departement 
     101echo User $Nom $Prenom $Login  
     102case $(hostname) in  
     103        hima*) COMMAND=/usr/local/bin  
     104               ;; 
     105        *) COMMAND="ssh -x -f -n root@ldap /usr/local/bin" 
     106esac     
     107cat /tmp/$$ | $COMMAND/latmosedit -f - $Login 
     108$COMMAND/latmosguser $Login $Statut $Vote $Status $Departement 
    84109 
    85110done 
Note: See TracChangeset for help on using the changeset viewer.