Changeset 427 for LATMOS-Accounts/addon-shell/epo2db.sh
- Timestamp:
- 09/05/09 09:14:45 (15 years ago)
- 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 3 if [ $# -ne 1 ] 4 then 5 FIC=~/epo-base.txt 6 elif [ -r $1 ] 7 then 8 FIC=$1 9 else 10 echo no file found 11 exit 1 12 fi 13 exec < $FIC 2 14 while 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 3 15 do … … 11 23 NickName=$(echo $K |sed -e 's/NICK//' -e 's/zzz//' ) 12 24 ArrivalDate=$(echo $L |sed -e 's/A//') 13 25 if [ $ArrivalDate -eq 19500101 ] 26 then 27 ArrivalDate="" 28 fi 14 29 BirthDate=$(echo $N |sed -e 's/N//') 15 30 ExpireDate=$(echo $M |sed -e 's/T//') 31 if [ $ExpireDate -eq 29990131 ] 32 then 33 ExpireDate="" 34 fi 16 35 Departement="$(echo $P|sed -e 's/DOM/ /g')" 17 36 # Gestion Votant … … 67 86 # Do the Stuff 68 87 cat <<EOF > /tmp/$$ 69 sn: "$Nom"70 givenName: "$Prenom"88 sn: $Nom 89 givenName: $Prenom 71 90 initials: $NickName 72 91 mail: $MailAddr … … 80 99 contratType: $ContratType 81 100 EOF 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 101 echo User $Nom $Prenom $Login 102 case $(hostname) in 103 hima*) COMMAND=/usr/local/bin 104 ;; 105 *) COMMAND="ssh -x -f -n root@ldap /usr/local/bin" 106 esac 107 cat /tmp/$$ | $COMMAND/latmosedit -f - $Login 108 $COMMAND/latmosguser $Login $Statut $Vote $Status $Departement 84 109 85 110 done
Note: See TracChangeset
for help on using the changeset viewer.