title: MD5 script. How to create a script if a md5check failes to retry the download script
body: <p>I got a script running for the downloading of the backups from my server.</p>
  
  <p>The files are being checked by MD5 is they are both the same.</p>
  
  <p>Here is my script:</p>
  
  <pre><code>if [[ ! "$1" =~ ^[0-9]{8}$ ]] || [[ ! "$2" =~ ^[0-9\.]+$ ]] || [[ ! "$3" =~ ^[A-Z0-9]+$ ]]
  then
     echo "Gebruik: backup_downloaden.sh jjjjmmdd ipadres naam"
     exit 1
  fi
  
  cd /home/backups/Servers
  
  scp -i /home/backups/.ssh/dedecaan_backups backups@$2:$3-$1-0500.tgz.gpg .
  scp -i /home/backups/.ssh/dedecaan_backups backups@$2:$3-$1-0500.tgz.gpg.md5 .
  scp -i /home/backups/.ssh/dedecaan_backups backups@$2:$3-$1-0500.tgz.gpg.volledig .
  
  date &gt; $3-$1.log
  ls -l $3-$1-* --time-style=long-iso &gt;&gt; $3-$1.log
  md5sum.textutils -c $3-$1-0500.tgz.gpg.md5 &gt;&gt; $3-$1.log
  
  scp -i /home/backups/.ssh/dedecaan_backups $3-$1.log backups@$2:$3-$1.log
  # logs altijd ook naar de productieserver kopiëren
  scp -i /home/backups/.ssh/dedecaan_backups $3-$1.log backups@85.17.173.168:$3-$1.log
  </code></pre>
  
  <p>I want if the check fails that the download job starts over again. How can I do this?</p>
  
  <p>Thanks</p>