| The Following User Says Thank You to venubvs For This Useful Post: | ||

| The Following 6 Users Say Thank You to ajf For This Useful Post: | ||

#!/bin/sh
XMLCFG=/tmp/navit.xml
NAVITROOT=/usr/share/navit
MAPPATH="${NAVITROOT} /media/mmc1/Maps /media/mmc2/Maps"
MAPCOUNT=0
cat ${NAVITROOT}/preamble.xml > ${XMLCFG}
cat ${NAVITROOT}/layout*.xml >> ${XMLCFG}
if which flite >/dev/null; then
cat ${NAVITROOT}/speech_flite.xml >> ${XMLCFG}
fi
for p in ${MAPPATH}; do
if [ -e $p ]; then
if [ `find $p -name *.bin | wc -l` -gt 0 ]; then
echo '<mapset enabled="yes">'
for m in `find $p -name *.bin`; do
echo '<map type="binfile" enabled="yes" data="'$m'"/>'
MAPCOUNT=$[${MAPCOUNT}+1]
done
echo '</mapset>'
fi
if [ `find $p -type d -name *.map | wc -l` -gt 0 ]; then
for m in `find $p -type d -name *.map`; do
echo '<mapset enabled="yes">'
echo '<map type="mg" enabled="yes" data="'$m'"/>'
for mm in `find $m -type d -name *.smp`; do
MAPCOUNT=$[${MAPCOUNT}+1]
done
echo '</mapset>'
fi
if [ `find $p -type d -name *.map | wc -l` -gt 0 ]; then
for m in `find $p -type d -name *.map`; do
echo '<mapset enabled="yes">'
echo '<map type="mg" enabled="yes" data="'$m'"/>'
for mm in `find $m -type d -name *.smp`; do
echo '<map type="mg" enabled="yes" data="'$mm'"/>'
done
echo '</mapset>'
MAPCOUNT=$[${MAPCOUNT}+1]
done
fi
if [ `find $p -name *.img | wc -l` -gt 0 ]; then
echo '<mapset enabled="yes">'
for m in `find $p -name *.img`; do
echo '<map type="garmin" enabled="yes" data="'$m'" debug="4"/>'
MAPCOUNT=$[${MAPCOUNT}+1]
done
echo '</mapset>'
fi
fi
done >> ${XMLCFG}
cat ${NAVITROOT}/postamble.xml >> ${XMLCFG}
exec ${NAVITROOT}/navit ${XMLCFG}