-
Notifications
You must be signed in to change notification settings - Fork 2
/
installUbuntu18.sh
67 lines (57 loc) · 1.51 KB
/
installUbuntu18.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
#!/bin/sh
. ${HOME}/etc/shell.conf
read -p "KML server IP: " serverIp
read -p "KML server Port: " serverPort
sed -i "s/##PORT##/$serverPort/" .env
sed -i "s/##IP##/$serverIp/" .env
#BUG FINDED! /document dosn't exist in some lgs
#ADD the kml viewsync into my places to auto load
sudo sed -i 's/<\/kml>//' ~/earth/kml/master/myplaces.kml
sudo sed -i 's/<\/Document>//' ~/earth/kml/master/myplaces.kml
sudo sed -i 's/<\/kml>//' ~/earth/kml/slave/myplaces.kml
sudo sed -i 's/<\/Document>//' ~/earth/kml/slave/myplaces.kml
sed -i "s/ServerAddress/$serverIp\:$serverPort/" documentation.json
cat >> ~/earth/kml/master/myplaces.kml << EOM
<Folder>
<name>KML API SYNC</name>
<open>1</open>
<NetworkLink>
<flyToView>5</flyToView>
<Link>
<href>http://$serverIp:$serverPort/kml/viewsync/master
</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>1</refreshInterval>
</Link>
</NetworkLink>
</Folder>
</Document>
</kml>
EOM
cat >> ~/earth/kml/slave/myplaces.kml << EOM
<Folder>
<name>KML API SYNC</name>
<open>1</open>
<NetworkLink>
<flyToView>5</flyToView>
<Link>
<href>http://$serverIp:$serverPort/kml/viewsync/slave
</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>1</refreshInterval>
</Link>
</NetworkLink>
</Folder>
</Document>
</kml>
EOM
#Build directory structure.
mkdir -p ~/kmlApi/images
for lg in $LG_FRAMES; do
if [ $lg != lg1 ]
then
echo $lg
scp ~/earth/kml/slave/myplaces.kml lg@$lg:~/earth/kml/slave/myplaces.kml
fi
done
exit 0