1*8caefee3SMatthias Ringwald#!/bin/bash 2*8caefee3SMatthias RingwaldUSAGE="Usage: upload_latest_sftp.sh host path user" 3*8caefee3SMatthias Ringwald 4*8caefee3SMatthias Ringwald# command line checks, bash 5*8caefee3SMatthias Ringwaldif [ $# -ne 3 ]; then 6*8caefee3SMatthias Ringwald echo ${USAGE} 7*8caefee3SMatthias Ringwald exit 0 8*8caefee3SMatthias Ringwaldfi 9*8caefee3SMatthias Ringwaldhost=$1 10*8caefee3SMatthias Ringwaldpath=$2 11*8caefee3SMatthias Ringwalduser=$3 12*8caefee3SMatthias Ringwald 13*8caefee3SMatthias Ringwaldecho Uploading generated archive to ${host}/${path} with user ${user} 14*8caefee3SMatthias Ringwald 15*8caefee3SMatthias Ringwald# SFTP is very peculiar: recursive put only works for a single directory 16*8caefee3SMatthias Ringwaldsftp ${user}@${host} << EOF 17*8caefee3SMatthias Ringwald put btstack-arduino-latest.zip ${path} 18*8caefee3SMatthias Ringwald quit 19*8caefee3SMatthias RingwaldEOF 20