diff --git a/Dockerfile-ubuntu b/Dockerfile-ubuntu index 4ff975198acd46b9e4b9de1796c46947eaba2751..021e424018eafb1a8d18309e362b8572b6a8e476 100644 --- a/Dockerfile-ubuntu +++ b/Dockerfile-ubuntu @@ -1,4 +1,4 @@ -FROM ubuntu +FROM docker.io/library/ubuntu:22.04 MAINTAINER Rob Powell <rob.p.tec@gmail.com> ENV DEBIAN_FRONTEND noninteractive @@ -8,8 +8,10 @@ RUN apt-get update RUN apt-get install -y \ build-essential \ pkg-config \ - libudev-dev - + libudev-dev \ + git \ + make \ + curl RUN mkdir /home/blinkdev @@ -23,4 +25,4 @@ RUN make ENV PATH ${HOME}/commandline:${PATH} -CMD ["blink1-tool", "-t 1000", "--random=100"] \ No newline at end of file +CMD ["alerts.sh"] diff --git a/alerts.sh b/alerts.sh new file mode 100755 index 0000000000000000000000000000000000000000..ef34cd22f4fe6245372d1f9ad06a221dcfb39103 --- /dev/null +++ b/alerts.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -x + +QUERY_EXPOSER_URL=${QUERY_EXPOSER_URL:-http://localhost:8080/} + +CODE="$(curl "${QUERY_EXPOSER_URL}")" + +if [ $? -gt 0 ]; then + blink1-tool -m 1000 --rgb=0,0,128 + exit 1 +fi + +if [ "$CODE" = "1" ]; then + blink1-tool -m 1000 --rgb=128,96,0 +elif [ "$CODE" = "2" ]; then + blink1-tool -m 1000 --rgb=128,0,0 +elif [ "$CODE" = "0" ] || [ "$CODE" = "" ]; then + blink1-tool -m 1000 --rgb=0,128,0 +fi