Mercurial > ~darius > hgwebdir.cgi > OverviewJD
comparison install.sh @ 0:57ffb39f29d4
First commit of new carousel page to allow battery charging current to
be adjusted.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 13 Dec 2021 23:05:38 +1030 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:57ffb39f29d4 |
---|---|
1 #!/bin/sh | |
2 | |
3 root=$(cd $(dirname $0); pwd) | |
4 qmldir=/opt/victronenergy/gui/qml | |
5 | |
6 cp -f $root/OverviewJD.qml $qmldir | |
7 if ! grep -lq "OverviewJD sentinel" $qmldir/main.qml; then | |
8 cp -f $qmldir/main.qml /tmp | |
9 (cd /tmp ; patch >/dev/null 2>&1 ) <$root/main.qml.diff | |
10 if [ $? -ne 0 ]; then | |
11 echo "Patching main.qml failed" | |
12 else | |
13 echo "Updating main.qml" | |
14 mv -f $qmldir/main.qml $qmldir/main.qml.orig | |
15 mv /tmp/main.qml $qmldir/ | |
16 fi | |
17 else | |
18 echo "main.qml already patched, skipping" | |
19 fi | |
20 # Create rc.local hooks for reinstallation | |
21 mkdir /data/rc.local.d /data/rcS.local.d >/dev/null 2>&1 | |
22 cat >/data/rc.local.d/overviewjd <<EOF | |
23 #!/bin/sh | |
24 sh $root/install.sh | |
25 EOF | |
26 | |
27 cat >/data/rc.local <<EOF | |
28 #!/bin/sh | |
29 for s in /data/rc.local.d/*; do | |
30 \$s | |
31 done | |
32 EOF | |
33 | |
34 cat >/data/rcS.local <<EOF | |
35 #!/bin/sh | |
36 for s in /data/rcS.local.d/*; do | |
37 \$s | |
38 done | |
39 EOF | |
40 | |
41 chmod 755 /data/rc.local.d/overviewjd /data/rc.local /data/rcS.local |