Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ftp_site=your_ftp_ip
  4. username=your_username
  5. password=your_password
  6. remote_path=public_html/your_site_dir
  7. local_site_dir=path/to/your/local/site/dir
  8. files_to_push_dir=_site #directory containing files to be pushed
  9.  
  10. # Check that we're in the correct directory
  11. if [ $PWD != $local_site_dir ]
  12. then
  13. echo "You're not in your site's directory."
  14. echo "Exiting."
  15. exit
  16. fi
  17.  
  18. #Preview file list
  19. echo "We're about to deploy the following files..."
  20. find $files_to_push_dir -exec echo {} \;
  21. echo ""
  22.  
  23. #Sign into ftp and upload files
  24. ftp -in <<EOF
  25. open $ftp_site
  26. user $username $password
  27. cd $remote_path
  28. lcd $files_to_push_dir
  29. mput *
  30. close
  31. bye
  32. EOF
  33.  
  34. echo ""
  35. echo "fin."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement