Skip to content

Instantly share code, notes, and snippets.

@mikecriggs
Created January 30, 2018 22:22
Show Gist options
  • Save mikecriggs/8c016fac303c69a4a59b8600c6b59ff2 to your computer and use it in GitHub Desktop.
Save mikecriggs/8c016fac303c69a4a59b8600c6b59ff2 to your computer and use it in GitHub Desktop.
Upload with sftp via bash
#!/bin/bash
#
# upload via sftp
#
# fill out the following definitions
DEVICE="$1"
ROM=""
USER=""
HOST=""
PASSWORD=""
# install sshpass
sudo apt install sshpass -y
# upload
export SSHPASS=$PASSWORD
sshpass -e sftp -oBatchMode=no -b - $USER@$HOST << !
put out/target/product/$DEVICE/$ROM*.zip
bye
!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment