xref: /btstack/doc/manual/upload_site_sftp.sh (revision 1ca3442b095800932529ce1cb5cf48a479563c50)
1*1ca3442bSMatthias Ringwald#!/bin/bash
2*1ca3442bSMatthias RingwaldUSAGE="Usage: upload_site_sftp.sh host path user"
3*1ca3442bSMatthias Ringwald
4*1ca3442bSMatthias Ringwald# command line checks, bash
5*1ca3442bSMatthias Ringwaldif [ $# -ne 3 ]; then
6*1ca3442bSMatthias Ringwald        echo ${USAGE}
7*1ca3442bSMatthias Ringwald        exit 0
8*1ca3442bSMatthias Ringwaldfi
9*1ca3442bSMatthias Ringwaldhost=$1
10*1ca3442bSMatthias Ringwaldpath=$2
11*1ca3442bSMatthias Ringwalduser=$3
12*1ca3442bSMatthias Ringwald
13*1ca3442bSMatthias Ringwaldecho Uploading generated docs to ${host}/${path}/btstack with user ${user}
14*1ca3442bSMatthias Ringwald
15*1ca3442bSMatthias Ringwald# SFTP is very peculiar: recursive put only works for a single directory
16*1ca3442bSMatthias Ringwaldsftp ${user}@${host} << EOF
17*1ca3442bSMatthias Ringwald  mkdir ${path}/btstack
18*1ca3442bSMatthias Ringwald  put -r btstack ${path}
19*1ca3442bSMatthias Ringwald  put btstack.pdf ${path}
20*1ca3442bSMatthias Ringwald  quit
21*1ca3442bSMatthias RingwaldEOF
22