From 0d2b6657938efb5fea908164823d73123a07be74 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 17 Nov 2022 20:11:13 +0100 Subject: [PATCH] shape nince --- 12345.sh | 2 +- tools/VISA.print.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/12345.sh b/12345.sh index 8ea986cb..05d4c580 100755 --- a/12345.sh +++ b/12345.sh @@ -418,7 +418,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh && rm ~/.zen/tmp/coucou/${MOATS}.newindex.html ########################### - # GET PLAYER FROM Dessin de $PLAYER (LE NOM DE LA CLEF IPNS EST DANS LE TITRE DE "Dessin de Moa" forgé à la création du TW) + # GET PLAYER FROM Dessin de $PLAYER tiddlywiki --load ~/.zen/tmp/coucou/${MOATS}.astroindex.html --output ~/.zen/tmp --render '.' 'MOA.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[moa]]' PLAYER=$(cat ~/.zen/tmp/MOA.json | jq -r .[].president) diff --git a/tools/VISA.print.sh b/tools/VISA.print.sh index 504977b7..ac17d04c 100755 --- a/tools/VISA.print.sh +++ b/tools/VISA.print.sh @@ -48,8 +48,13 @@ sudo brother_ql_print /tmp/toprint.bin $LP ################################################################ ### PRINT PLAYER TW myIP link myIP=$(hostname -I | awk '{print $1}' | head -n 1) +isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") +[[ ! $myIP || $isLAN ]] && myIP="astroport.localhost" + +TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3) + playerns=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) -qrencode -s 12 -o "$HOME/.zen/tmp/QR.ASTRO.png" "http://$myIP:8080/ipns/$playerns" +qrencode -s 12 -o "$HOME/.zen/tmp/QR.ASTRO.png" "http://$TUBE:8080/ipns/$playerns" convert $HOME/.zen/tmp/QR.ASTRO.png -resize 600 /tmp/playerns.png brother_ql_create --model QL-700 --label-size 62 /tmp/playerns.png > /tmp/toprint.bin 2>/dev/null