title: Cap task fetches content locally
body: <p>I guess some thing is wrong with this part.</p>
  
  <pre><code>check = %x( cat '/etc/apache2/ports.conf' )
  </code></pre>
  
  <p>I want to fetch the content from /etc/apache2/ports.conf and check if port 8581 is already listened, heres my code, Its an after deployment cap task.</p>
  
  <pre><code>desc "Ports Updation"
  task :portsUpdation do
     # Editing /etc/apache2/ports.conf
      ports_file = "/etc/apache2/ports.conf"
      run "#{try_sudo} chmod -R 0777 #{ports_file}" 
  
      check = %x( cat '/etc/apache2/ports.conf' )
      puts check
  
      unless /Listen 8581/.match check
          run "#{try_sudo} sed -i '$ a\Listen 8581\n' #{ports_file}"
      end
      run "#{try_sudo} chmod -R 0644 #{ports_file}"
  end
  </code></pre>
  
  <p>I ran this cap task and the variable 'check' always prints ports.conf which is in my local. What i want is the contents from server. </p>
  
  <p>When i ran this cap task i was asked server password. I also tried cap deploy. Same result. What may be the pblm.</p>