From 3d29a5b36fafb4b5f1391b864f20deb7b7b4b040 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 14 Apr 2023 22:23:42 +0200 Subject: [PATCH] G1Voeu WISHKEY is G1PUB --- API/QRCODE.sh | 4 ++-- ASTROBOT/G1Voeu.sh | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/API/QRCODE.sh b/API/QRCODE.sh index 4d432dec..3820deb0 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -168,7 +168,7 @@ fi if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then VOEU=${QRCODE} - ASTROPATH=$(grep -r ${THIS} ~/.zen/game/players/*/ipfs/moa | grep ${QRCODE} | cut -d ':' -f 1 | rev | cut -d '/' -f 2- | rev 2>/dev/null) + ASTROPATH=$(grep -r ${THIS} ~/.zen/game/players/*/ipfs/moa | grep ${QRCODE} | tail -n 1 | cut -d ':' -f 1 | rev | cut -d '/' -f 2- | rev 2>/dev/null) echo $ASTROPATH INDEX=$ASTROPATH/index.html @@ -196,7 +196,7 @@ if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then echo "## IPNS G1Voeu APP REDIRECT" tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${MOATS}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]' cat ~/.zen/tmp/${MOATS}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${MOATS}.g1wishes.txt - + cat ~/.zen/tmp/${MOATS}.g1wishes.txt while read WISH do [[ ${WISH} == "" || ${WISH} == "null" ]] && echo "BLURP. EMPTY WISH" && continue diff --git a/ASTROBOT/G1Voeu.sh b/ASTROBOT/G1Voeu.sh index 2d5ad5cc..8773dc61 100755 --- a/ASTROBOT/G1Voeu.sh +++ b/ASTROBOT/G1Voeu.sh @@ -53,9 +53,12 @@ mkdir -p ~/.zen/tmp/$MOATS echo "$PEPPER" && [[ ! $PEPPER ]] && echo "EMPTY PEPPER - ERROR" && exit 1 echo "## keygen PLAYER DERIVATE WISH KEY" - ${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/wish.dunikey "$SALT" "$PEPPER" - WISHKEY=$(cat ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/wish.dunikey | grep "pub:" | cut -d ' ' -f 2) + ${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/$MOATS/wish.dunikey "$SALT" "$PEPPER" + WISHKEY=$(cat ~/.zen/tmp/$MOATS/wish.dunikey | grep "pub:" | cut -d ' ' -f 2) echo "WISHKEY (G1PUB) = $WISHKEY" + [[ $WISHKEY == "" ]] && echo "EMPTY WISHKEY G1PUB - ERROR" && exit 1 + mkdir -p ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/ + mv ~/.zen/tmp/$MOATS/wish.dunikey ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/wish.dunikey echo "# NOUVEAU VOEU" mkdir -p ~/.zen/game/players/$PLAYER/voeux/$PEPPER/$WISHKEY/