Home | History | Annotate | Download | only in chromeos
      1 #!/bin/bash
      2 set -e -o pipefail
      3 
      4 # Copy a file or directory to the target ChromeOS device.
      5 #
      6 # Usage: target_cp <src> <target>:<dest>
      7 
      8 src="$1"
      9 shift
     10 
     11 targetdest="$1"
     12 shift
     13 
     14 target="${targetdest%:*}"
     15 dest="${targetdest#*:}"
     16 
     17 if [[ -z "${src}" || -z "${target}" || -z "${dest}" || "${targetdest}" != "${target}:${dest}" || -n "$*" ]]
     18 then
     19 	echo "Usage: target_cp <src> <target>:<dest>"
     20 	exit 1
     21 fi
     22 
     23 if [[ -d ${src} ]]
     24 then
     25 	scp -rq ${src} ${target}:${dest}
     26 else
     27 	scp -q ${src} ${target}:${dest}
     28 fi
     29