aboutsummaryrefslogtreecommitdiff
path: root/setup/linux/traccar.sh
blob: 073aca14456302bbeafba9fdd5c6fa2f62c35e10 (plain)
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
#!/bin/sh

app='/opt/traccar'

rm -f -R out

mkdir out
mkdir out/bin
mkdir out/conf
mkdir out/data
mkdir out/lib
mkdir out/logs

cp wrapper/bin/wrapper out/bin
cp wrapper/src/bin/sh.script.in out/bin/traccar
cp wrapper/lib/libwrapper.so out/lib
cp wrapper/lib/wrapper.jar out/lib
cp wrapper/src/conf/wrapper.conf.in out/conf/wrapper.conf

cp tracker-server.jar out
cp lib/* out/lib
cp linux.cfg out/conf

chmod +x out/bin/traccar

sed -i 's/@app.name@/traccar/g' out/bin/traccar
sed -i 's/@app.long.name@/traccar/g' out/bin/traccar

sed -i '/wrapper.java.classpath.1/i\wrapper.java.classpath.2=../tracker-server.jar' out/conf/wrapper.conf
sed -i "/wrapper.app.parameter.1/i\wrapper.app.parameter.2=$app/conf/linux.cfg" out/conf/wrapper.conf
sed -i 's/<YourMainClass>/Main/g' out/conf/wrapper.conf
sed -i 's/@app.name@/traccar/g' out/conf/wrapper.conf
sed -i 's/@app.long.name@/traccar/g' out/conf/wrapper.conf
sed -i 's/@app.description@/traccar/g' out/conf/wrapper.conf

makeself out traccar.run "traccar" "mkdir /opt/traccar; cp -f -R * /opt/traccar; /opt/traccar/bin/traccar install"

rm -f -R out