pp-covidcert

Vaccination Certificate fpor the EU
git clone https://src.jayvii.de/pub/pp-covidcert.git
Log | Files | Refs

commit 77634306ad30d87d336cb3f37ed1df552630d551
Author: JayVii <jayvii@posteo.de>
Date:   Tue, 24 Aug 2021 11:49:50 +0200

initial version

Diffstat:
App-covidcert.sh | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+), 0 deletions(-)

diff --git a/pp-covidcert.sh b/pp-covidcert.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +CERTDIR="~/.local/share/pp-covidcert" +CERDAT01="$CERTDIR/cert01.txt" +CERDAT02="$CERTDIR/cert02.txt" +CERT01="$CERTDIR/cert01.png" +CERT02="$CERTDIR/cert02.png" + +function prompt_nocerts { + yad --title="EU Digital COVID Pass" \ + --text="One or more of your certificates do not seem to exist yet." \ + --form \ + --field="Try to recover from Cert-Code file:CHK" \ + --button="Load Certificates" +} + +function prompt_nocertdata { + yad --title="EU Digital COVID Pass" \ + --text="There seems to be an issue with your Cert-Code file..." \ + --form \ + --button="Load Certificates manually" + prompt_loadcertdata "$1" "$2" +} + +function prompt_loadcertdata { + yad --title="EU Digital COVID Pass" \ + --text="Scan and copy your vaccination QR Code information below." \ + --form \ + --field="Vaccination #$1" Text \ + --button="Create QR Code" +} + +function prompt_main { + yad --title="EU Digital COVID Pass" \ + --text="Which Certificate should be displayed?" \ + --form \ + --field="Show Certificate 01:CHK" \ + --field="Show Certificate 02:CHK" +} + +function prompt_showcert { + yad --title="EU Digital COVID Pass" \ + --image="$1" +} + +if [[ ! -f "$CERT01" ]] || [[ ! -f "$CERT02" ]]; then + + prompt_nocerts + + if [[ $(cut -d "|" -f1) == "TRUE" ]]; then + if [[ -f "$CERTDAT01" ]]; then + cat "$CERTDAT01" | qrencode -o "$CERT01" + else + prompt_nocertdata "01" "$CERT01" + fi + if [[ -f "$CERTDAT02" ]]; then + cat "$CERTDAT02" | qrencode -o "$CERT02" + else + prompt_nocertdata "02" "$CERT02" + fi + else + prompt_loadcertdata "01" | cut -d "|" -f1 | qrencode -o "$CERT01" + prompt_loadcertdata "02" | cut -d "|" -f1 | qrencode -o "$CERT02" + fi + +fi + +CLOSE_APPLICATION=0 + +while [[ $CLOSE_APPLICATION != 0 ]]; do + + CHOOSE=$(prompt_main) + + if [[ $(printf "$CHOOSE" | cut -d "|" -f1) == "TRUE" ]]; then + prompt_showcert "$CERT01" + fi + if [[ $(printf "$CHOOSE" | cut -d "|" -f2) == "TRUE" ]]; then + prompt_showcert "$CERT02" + fi + + CLOSE_APPLICATION=$? + +done + +# EOF pp-covidcert.sh