diff options
author | Shaun Taheri <github@taheris.co.uk> | 2016-08-10 18:19:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-10 18:19:29 +0200 |
commit | 1ddcfd1bdd3e68a4c7cc558986df84d7b4757f7b (patch) | |
tree | 3a8ac9ab66e751bbef29fad9ee3352b913f1eb87 | |
parent | 90c66bcf4f8965175c1cb08399d7891b9b01bc5c (diff) | |
parent | 8acfaec60545c041dc01ac93b80ceac76ba8fdc5 (diff) | |
download | rvi_sota_client-1ddcfd1bdd3e68a4c7cc558986df84d7b4757f7b.tar.gz |
Merge pull request #89 from advancedtelematic/feat/PRO-1007-sota-system-info
Add sota-system-info script
-rw-r--r-- | run/Dockerfile | 2 | ||||
-rwxr-xr-x | run/sota-system-info | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/run/Dockerfile b/run/Dockerfile index 79799cf..d516382 100644 --- a/run/Dockerfile +++ b/run/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \ libdbus-1-3 \ libdbus-glib-1-2 \ openssl \ + lshw \ && rm -rf /var/lib/apt/lists/* \ && mkdir /var/sota @@ -16,6 +17,7 @@ COPY sota_client /usr/bin/ COPY sota.toml.template /etc/ COPY sota_certificates /etc/ COPY run.sh /usr/bin/ +COPY sota-system-info /usr/bin/ EXPOSE 8888 9080 CMD ["/usr/bin/run.sh"] diff --git a/run/sota-system-info b/run/sota-system-info new file mode 100755 index 0000000..8ead73a --- /dev/null +++ b/run/sota-system-info @@ -0,0 +1,9 @@ +#!/bin/bash + +INFO=$(lshw -json -sanitize) + +MANIFEST_PATH=/etc/manifest.xml +if [ -f $MANIFEST_PATH ]; then + MANIFEST={\"manifest_file\":\"$( cat $MANIFEST_PATH | sed 's/"/\\"/'g | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g' )\"} + echo $MANIFEST $INFO | jq -s add | jq -r . +fi |