package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / support / download / scp
blob95cf502be2f4ef0d70d9a6f35cae2b5ac0e7e9fc
1 #!/usr/bin/env bash
3 # We want to catch any unexpected failure, and exit immediately
4 set -e
6 # Download helper for scp, to be called from the download wrapper script
8 # Call it as:
9 # .../scp [-q] OUT_FILE SRC_URL
11 # Environment:
12 # SCP : the scp command to call
14 verbose=
15 while getopts :q OPT; do
16 case "${OPT}" in
17 q) verbose=-q;;
18 \?) printf "unknown option '%s'\n" "${OPTARG}" >&2; exit 1;;
19 esac
20 done
21 shift $((OPTIND-1))
23 output="${1}"
24 url="${2}"
26 # Caller needs to single-quote its arguments to prevent them from
27 # being expanded a second time (in case there are spaces in them)
28 _scp() {
29 eval ${SCP} "${@}"
32 _scp ${verbose} "'${url}'" "'${output}'"