mapviewer: remove recipe due to package being deprecated
[AGL/meta-agl-demo.git] / recipes-demo-hmi / navigation / navigation / download_mapdata_jp.sh
1 #!/bin/sh
2 #
3 # AGL Navigation mapdata download scripts
4 #
5
6 #--------------------------------------------------------------
7 help()
8 {
9 bn=`basename $0`
10 cat << EOF
11 usage
12 host: sudo $bn 'target_rootfs_path/'
13 target : $bn /
14 EOF
15
16 }
17 #-check para-------------------------------------------------------
18 shift `expr $OPTIND - 1`
19
20 if [ $# != 1  ]; then
21         help
22         exit
23 fi
24
25 rootfs=$1
26
27 #----------------------------------------------------------------
28
29 # check the if root? ------------------------------
30 userid=`id -u`
31 if [ $userid -ne "0" ]; then
32         echo "you're not root? run with sudo"
33         exit
34 fi
35
36 if [ ! -e $1 ]; then
37         echo "rootfs:$1 not found"
38         exit
39 fi
40
41 if [ ! -f $HOME/navi_data.tar.gz ]; then
42         echo "no map data"
43         echo "start downloading..."
44         wget --directory-prefix=$HOME http://agl.wismobi.com/data/japan_TR9/navi_data.tar.gz
45 else
46         echo "use downloaded map data"
47 fi
48
49 mapdatadir=$rootfs/var/mapdata
50
51 if [ ! -d $mapdatadir ]; then
52         echo "map data directory does not exist"
53         echo "create a directory" $mapdatadir
54         mkdir -p $mapdatadir
55 else
56         echo "map data directory exists"
57 fi
58
59 tar xvzf $HOME/navi_data.tar.gz -C $mapdatadir
60 sync
61 echo "done.."