scp_upload.sh: use ENV variable to set IP of RPi2

This commit is contained in:
Julian Oes 2016-06-24 19:41:43 +02:00 committed by Lorenz Meier
parent 4c0ed8bdd5
commit ea7cebbf10
1 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,14 @@ if [[ "$#" < 2 ]]; then
exit exit
fi fi
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
echo "Uploading..." echo "Uploading..."
# Get last argument # Get last argument
@ -19,6 +27,6 @@ do
fi fi
# echo "Pushing $arg to $last" # echo "Pushing $arg to $last"
#adb push $arg $last #adb push $arg $last
scp $arg pi@px4autopilot:$last scp $arg pi@$host:$last
((i+=1)) ((i+=1))
done done