1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/bin/sh
PNAME=${PNAME:-./gpsbabel}
DIFF=${DIFF:-diff}
TMPDIR=${GBTEMP:-/tmp}/gpsbabel.$$
mkdir -p $TMPDIR
trap "rm -fr $TMPDIR" 0 1 2 3 15
#
# This is nasty. If we have a dictionary handy, treat it as a list of
# waypoints and reduce all the names to eight characters. Fewer chars
# results in lost waypoints currently and that's a defect.
#
DICT=/usr/share/dict/words
if [ -f $DICT ];
then
WORDS=`cat $DICT | wc -l`
SWORDS=`${PNAME} -i gpsdrive -f $DICT -o gpsdrive,snlen=8 -F /dev/fd/1 |
wc -l`
if [ $WORDS -ne $SWORDS ];
then
echo "Shortname reduction failed."
exit 1
fi
fi
exit 0
|