Last active
August 29, 2015 14:00
-
-
Save erikkallen/11153072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]} [email protected]:` | |
`ssh [email protected] "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