| Last change
                  on this file since 15 was
                  6,
                  checked in by guillaume, 18 years ago | 
        
          | 
Publication tt-ttols v0.1Des outils pour le TwinTact
 
 | 
        
          | 
              
                  Property svn:executable set to
                  * | 
        | File size:
            873 bytes | 
      
      
        
  | Line |  | 
|---|
| 1 | #! /bin/bash | 
|---|
| 2 |  | 
|---|
| 3 | source versions.sh | 
|---|
| 4 |  | 
|---|
| 5 | [ -d archives ] || mkdir archives | 
|---|
| 6 | cd archives | 
|---|
| 7 |  | 
|---|
| 8 | for a in $ARCHIVES | 
|---|
| 9 | do | 
|---|
| 10 | eval tar="\${${a}_TAR}" | 
|---|
| 11 | eval url="\${${a}_URL}" | 
|---|
| 12 | eval sha="\${${a}_SHA}" | 
|---|
| 13 |  | 
|---|
| 14 | if [ -e "$tar" ]; then | 
|---|
| 15 | chk="$(sha1sum $tar|cut -d' ' -f1)" | 
|---|
| 16 | if [ "$chk" == "$sha" ]; then | 
|---|
| 17 | echo "L'archive $tar est déjà présente" | 
|---|
| 18 | continue | 
|---|
| 19 | else | 
|---|
| 20 | echo "L'archive $tar est déjà présente mais semble être corrompue..." | 
|---|
| 21 | echo "SHA1 du fichier local: $chk" | 
|---|
| 22 | echo "Empreinte SHA1 attendue: $sha" | 
|---|
| 23 | echo | 
|---|
| 24 | echo "Effacez le fichier '$PWD/$tar' et recommencez le téléchargement" | 
|---|
| 25 | exit 1 | 
|---|
| 26 | fi | 
|---|
| 27 | fi | 
|---|
| 28 |  | 
|---|
| 29 | # Télécharger l'archive | 
|---|
| 30 | wget -nd "${url}/${tar}" | 
|---|
| 31 |  | 
|---|
| 32 | chk="$(sha1sum $tar|cut -d' ' -f1)" | 
|---|
| 33 | if [ "$chk" == "$sha" ]; then | 
|---|
| 34 | echo "L'empreinte SHA1 de l'archive téléchargée est correcte" | 
|---|
| 35 | else | 
|---|
| 36 | echo "ATTENTION ! L'archive '$PWD/$tar' semble corrompue" | 
|---|
| 37 | exit 2 | 
|---|
| 38 | fi | 
|---|
| 39 | done | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.