Last active
August 29, 2015 14:16
-
-
Save vti/bc1b628c23c084f13825 to your computer and use it in GitHub Desktop.
Reliably send GPX to Garmin EDGE 500
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/sh | |
#set -x | |
FILE=$1 | |
DEV=$2 | |
MOUNT=/tmp/garmin | |
FILE_BASENAME="${FILE%.gpx}" | |
FILE_DATES="$FILE_BASENAME-dates.gpx" | |
FILE_TCX="$FILE_BASENAME.tcx" | |
sudo umount $DEV | |
sudo dosfsck -av $DEV | |
mkdir $MOUNT 2>/dev/null | |
sudo mount -t vfat $DEV $MOUNT | |
gpsbabel -i gpx -f $FILE -x track,faketime=f19780705200000+2 -o gpx -F $FILE_DATES | |
gpsbabel -i gpx -f $FILE_DATES -o gtrnctr -F $FILE_TCX | |
sudo cp $FILE_TCX $MOUNT/Garmin/NewFiles/ | |
sudo umount $DEV | |
sudo eject $DEV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment