Skip to content

Instantly share code, notes, and snippets.

@erikkallen
Last active August 29, 2015 14:00
Show Gist options
  • Save erikkallen/11153072 to your computer and use it in GitHub Desktop.
Save erikkallen/11153072 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Still work in progress!
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
CMD_ARGS=($@)
NEW_ARGS="${CMD_ARGS[3]} ${CMD_ARGS[4]} ${CMD_ARGS[5]} ${CMD_ARGS[6]} ${CMD_ARGS[8]}"
if [ "$8" == "-P/dev/tty.Bluetooth-Incoming-Port" ]; then
echo "starting hack"
OLDIFS=IFS
IFS=':'
filename=(${11})
IFS=OLDIFS
echo ${NEW_ARGS}
`scp ${filename[2]} pi@10.0.1.50:`
`ssh pi@10.0.1.50 "sudo avrdude ${NEW_ARGS} -P/dev/ttyAMA0 -Uflash:w:HomeController.cpp.hex:i"`
else
echo "Regular avrdude "
`${SCRIPTPATH}/avrdude-original $@`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment