Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ftp_site=your_ftp_ip
- username=your_username
- password=your_password
- remote_path=public_html/your_site_dir
- local_site_dir=path/to/your/local/site/dir
- files_to_push_dir=_site #directory containing files to be pushed
- # Check that we're in the correct directory
- if [ $PWD != $local_site_dir ]
- then
- echo "You're not in your site's directory."
- echo "Exiting."
- exit
- fi
- #Preview file list
- echo "We're about to deploy the following files..."
- find $files_to_push_dir -exec echo {} \;
- echo ""
- #Sign into ftp and upload files
- ftp -in <<EOF
- open $ftp_site
- user $username $password
- cd $remote_path
- lcd $files_to_push_dir
- mput *
- close
- bye
- EOF
- echo ""
- echo "fin."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement