2016-04-29 01:09:23 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ "$#" < 2 ]]; then
|
|
|
|
echo "usage: scp_upload.sh SRC1 [SRC2 ...] DEST"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2016-06-24 14:41:43 -03:00
|
|
|
if [ -z ${AUTOPILOT_HOST+x} ]; then
|
|
|
|
host=px4autopilot
|
|
|
|
echo "\$AUTOPILOT_HOST is not set (use default: $host)"
|
|
|
|
else
|
|
|
|
host=$AUTOPILOT_HOST
|
|
|
|
echo "\$AUTOPILOT_HOST is set to $host"
|
|
|
|
fi
|
|
|
|
|
2016-04-29 01:09:23 -03:00
|
|
|
echo "Uploading..."
|
|
|
|
|
|
|
|
# Get last argument
|
|
|
|
for last; do true; done
|
|
|
|
|
|
|
|
# Go through source files and push them one by one.
|
|
|
|
i=0
|
|
|
|
for arg
|
|
|
|
do
|
|
|
|
if [[ $((i+1)) == "$#" ]]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
# echo "Pushing $arg to $last"
|
|
|
|
#adb push $arg $last
|
2016-06-24 14:41:43 -03:00
|
|
|
scp $arg pi@$host:$last
|
2016-04-29 01:09:23 -03:00
|
|
|
((i+=1))
|
|
|
|
done
|