-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·97 lines (88 loc) · 2.58 KB
/
install.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
# This file is useful to install ital.img dependencies
### VARIABILI CHE POSSONO ESSERE MODIFICATE ##
mkgmap="mkgmap-r4916"
splitter="splitter-r653"
#ciclo per vedere le opzioni scelte
while getopts "f" Opzione
do
case $Opzione in
#opzione per forzare l'installazione dei software
f ) FORCE=1;;
esac
done
if which aria2c >/dev/null; then
DOWN=aria2c
elif which wget >/dev/null; then
DOWN=wget
elif which curl >/dev/null; then
DOWN=curl
else
echo "'aria2c', 'wget' or 'curl' is required, please install one of this tool"
exit 1
fi
if [ ! `which unzip` ]; then
echo "unzip is required, please install it"
fi
if [ "$(id -u)" != "0" ]; then
echo "To install osmconvert you should be root" 1>&2
else
if [ ! `which osmconvert` ]; then
wget -O - http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o /usr/local/bin/osmconvert
else
if [ "$FORCE" ] ; then
rm -rf /usr/local/bin/osmconvert
wget -O - http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o /usr/local/bin/osmconvert
fi
fi
fi
if [ ! -d $mkgmap ]; then
$DOWN http://www.mkgmap.org.uk/download/${mkgmap}.tar.gz
tar xzf ${mkgmap}.tar.gz
rm -f ${mkgmap}.tar.gz
fi
if [ ! -d $splitter ]; then
$DOWN http://www.mkgmap.org.uk/download/${splitter}.tar.gz
tar xzf ${splitter}.tar.gz
rm -f ${splitter}.tar.gz
fi
sed -i "/mkgmap=/c\mkgmap=\"${mkgmap}\"" italimg.sh
sed -i "/splitter=/c\splitter=\"${splitter}\"" italimg.sh
sed -i "/mkgmap=/c\mkgmap=\"${mkgmap}\"" other_nation.sh
sed -i "/splitter=/c\splitter=\"${splitter}\"" other_nation.sh
if [ ! -d sea ]; then
$DOWN https://www.thkukuk.de/osm/data/sea-latest.zip
unzip sea-latest.zip
rm -f sea-latest.zip
else
if [ "$FORCE" ]; then
rm -rf sea
$DOWN https://www.thkukuk.de/osm/data/sea-latest.zip
unzip sea-latest.zip
rm -f sea-latest.zip
fi
fi
if [ ! -d bounds ]; then
$DOWN https://www.thkukuk.de/osm/data/bounds-latest.zip
unzip bounds-latest.zip -d bounds
rm -f bounds-latest.zip
else
if [ "$FORCE" ]; then
rm -rf bounds
$DOWN https://www.thkukuk.de/osm/data/bounds-latest.zip
unzip bounds-latest.zip -d bounds
rm -f bounds-latest.zip
fi
fi
if [ ! -f cities15000.txt ]; then
$DOWN -c http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
rm -f cities15000.zip
else
if [ "$FORCE" ]; then
rm -rf cities15000.txt
$DOWN http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
rm -f cities15000.zip
fi
fi