title: Bash - rsync list of servers
body: <p>I want that a bash script reads a file and execute rsync referring the logindetails of the file.
  I have a seperate file with login details to all servers.</p>
  
  <p>I want to use follow format:</p>
  
  <pre><code>server=1
  type=openvz
  ip=1.1.1.1
  port=22
  user=root
  pwd=something
  rpath=/home/private/
  lpath=s1/
  
  server=2
  type=openvz
  ip=1.1.1.2
  port=22
  user=root
  pwd=something
  rpath=/home/private/
  lpath=s2/
  </code></pre>
  
  <p>Please can somebody tell me how can i make a correct loop of the main script to grep all the datas from the logindetails file and make rsync each to other?
  example rsync script:</p>
  
  <pre><code>source serverlist
  sshpass -p $pwd rsync -av --delete $user@$ip:$rpath /home/backup/$lpath
  </code></pre>
  
  <p>I think this must get done via loop, but i dont know how to tell bash to take each server  after another</p>
  
  <p>Thank you for your help!</p>