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