plus joli comme ça

This commit is contained in:
fred 2023-04-20 15:09:17 +02:00
parent b99e3bc8a1
commit 5888e06eb6
3 changed files with 94 additions and 81 deletions

View File

@ -15,27 +15,30 @@ echo "## RUNNING PLAYER.refresh"
PLAYERONE="$1"
# [[ $isLAN ]] && PLAYERONE=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ! $PLAYERONE ]] && PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
[[ ! ${PLAYERONE} ]] && PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null))
echo "FOUND : ${PLAYERONE[@]}"
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
[[ ! -d ~/.zen/game/players/${PLAYER:-undefined} ]] && echo "BAD $PLAYERONE" && continue
[[ ! $(echo "$PLAYER" | grep '@') ]] && continue
[[ ! -d ~/.zen/game/players/${PLAYER:-undefined} ]] && echo "BAD ${PLAYERONE}" && continue
[[ ! $(echo "${PLAYER}" | grep '@') ]] && continue
# CLEAN LOST ACCOUNT
[[ ! -f ~/.zen/game/players/$PLAYER/secret.dunikey ]] && rm -Rf ~/.zen/game/players/$PLAYER
[[ ! -s ~/.zen/game/players/${PLAYER}/secret.dunikey ]] \
&& rm -Rf ~/.zen/game/players/${PLAYER} \
&& echo "LOST ${PLAYER} IS OUT" \
&& continue
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
mkdir -p ~/.zen/tmp/${MOATS}
echo "##################################################################"
echo ">>>>> PLAYER : $PLAYER >>>>>>>>>>>>> REFRESHING TW STATION"
echo ">>>>> PLAYER : ${PLAYER} >>>>>>>>>>>>> REFRESHING TW STATION"
echo "##################################################################"
PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/$PLAYER/.playerns 2>/dev/null)
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
# Get PLAYER wallet amount
COINS=$($MY_PATH/../tools/COINScheck.sh $G1PUB | tail -n 1)
echo "+++ WALLET BALANCE _ $COINS (G1) _"
@ -47,43 +50,42 @@ for PLAYER in ${PLAYERONE[@]}; do
## REFRESH ASTRONAUTE TW
ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "WARNING No $PLAYER in keystore --" && ASTRONAUTENS=$ASTRONS
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! ${ASTRONAUTENS} ]] \
&& echo "WARNING No ${PLAYER} in keystore WARNING WARNING" \
&& ASTRONAUTENS=$ASTRONS
echo ">>> $myIPFS/ipns/$ASTRONAUTENS"
echo ">>> $myIPFS/ipns/${ASTRONAUTENS}"
## VISA EMITER STATION MUST ACT ONLY
[[ ! -f ~/.zen/game/players/$PLAYER/secret.dunikey ]] && echo "$PLAYER secret.dunikey NOT HERE CONTINUE -- " \
&& mv ~/.zen/game/players/$PLAYER ~/.zen/game/players/.$PLAYER && continue
## MY PLAYER : RESTORE PLAYER KEY FROM G1PUB (IN CASE IS MISSING : PLAYER LOGOUT)
ipfs key export $G1PUB -o ~/.zen/tmp/${MOATS}/${PLAYER}.key
[[ ! $(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1) ]] && ipfs key import ${PLAYER} ~/.zen/tmp/${MOATS}/${PLAYER}.key
rm ~/.zen/tmp/${MOATS}/${PLAYER}.key
## MY PLAYER : RESTORE PLAYER KEY FROM G1PUB
ipfs key export $G1PUB -o ~/.zen/tmp/${MOATS}/$PLAYER.key
[[ ! $(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) ]] && ipfs key import $PLAYER ~/.zen/tmp/${MOATS}/$PLAYER.key
rm -f ~/.zen/tmp/${MOATS}/$PLAYER.key
## REFRESH CACHE
## REFRESH PLAYER IN STATION CACHE
rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
echo "Getting latest online TW..."
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
echo "/ipns/$ASTRONAUTENS ON $LIBRA"
echo "/ipns/${ASTRONAUTENS} ON $LIBRA"
ipfs --timeout 360s get -o ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html /ipns/$ASTRONAUTENS \
|| curl -m 60 -so ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$LIBRA/ipns/$ASTRONAUTENS" \
|| cp ~/.zen/game/players/$PLAYER/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
## IPFS / HTTP / LOCAL
ipfs --timeout 360s get -o ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html /ipns/${ASTRONAUTENS} \
|| curl -m 60 -so ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$LIBRA/ipns/${ASTRONAUTENS}" \
|| cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
## PLAYER TW IS ONLINE ?
if [ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ]; then
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "ERROR_PLAYERTW_OFFLINE : /ipns/$ASTRONAUTENS"
echo "ERROR_PLAYERTW_OFFLINE : /ipns/${ASTRONAUTENS}"
echo "------------------------------------------------"
echo "MANUAL PROCEDURE NEEDED"
echo "------------------------------------------------"
echo "$myIPFS/ipfs/"
echo "/ipfs/"$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.chain.* | tail -n 1)
echo "ipfs name publish -t 24h --key=$PLAYER ..."
echo "/ipfs/"$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.* | tail -n 1)
echo "ipfs name publish -t 24h --key=${PLAYER} ..."
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
continue
@ -100,8 +102,8 @@ for PLAYER in ${PLAYERONE[@]}; do
player=$(cat ~/.zen/tmp/${MOATS}/MadeInZion.json | jq -r .[].player)
[[ $player == $PLAYER ]] \
&& echo "$PLAYER OFFICIAL TW - (⌐■_■) -" \
[[ $player == ${PLAYER} ]] \
&& echo "${PLAYER} OFFICIAL TW - (⌐■_■) -" \
|| ( echo "> BAD PLAYER=$player in TW" && continue)
## DETECT IF GOOD ASTROPORT
@ -110,8 +112,8 @@ for PLAYER in ${PLAYERONE[@]}; do
--render '.' 'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
ASTROPORT=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].astroport)
CURCHAIN=$(cat ~/.zen/tmp/${MOATS}/Astroport.json | jq -r .[].chain | rev | cut -f 1 -d '/' | rev) # Remove "/ipfs/" part
[[ $CURCHAIN == "" || $CURCHAIN == "null" ]] && CURCHAIN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # AVOID EMPTY
echo "CURCHAIN=$CURCHAIN"
[[ ${CURCHAIN} == "" || ${CURCHAIN} == "null" ]] && CURCHAIN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # AVOID EMPTY
echo "CURCHAIN=${CURCHAIN}"
IPNSTAIL=$(echo ${ASTROPORT} | rev | cut -f 1 -d '/' | rev) # Remove "/ipns/" part
echo "TW ASTROPORT GATEWAY : ${ASTROPORT}"
@ -124,30 +126,29 @@ for PLAYER in ${PLAYERONE[@]}; do
ipfs key rm $vk
done
rm -Rf ~/.zen/game/players/${PLAYER}/
echo ">>>> ASTRONAUT ${PLAYER} EJECTION OPERATION FINISHED"
echo ">>>> ASTRONAUT ${PLAYER} TW CAPSULE EJECTION TERMINATED"
continue
fi
fi
#############################################################
## GWIP == myIP or TUBE !!
#############################################################
# Connect_PLAYER_To_Gchange.sh : Sync FRIENDS TW
##############################################################
echo "##################################################################"
echo "## GCHANGE+ & Ŋ1 EXPLORATION: Connect_PLAYER_To_Gchange.sh"
${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "$PLAYER"
${MY_PATH}/../tools/Connect_PLAYER_To_Gchange.sh "${PLAYER}"
# VOEUX.create.sh
##############################################################
## SPECIAL TAG "voeu" => Creation G1Voeu (G1Titre) makes AstroBot TW G1Processing
##############################################################
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "$PLAYER"
${MY_PATH}/VOEUX.create.sh ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html "${PLAYER}"
# VOEUX.refresh.sh
##############################################################
## RUN ASTROBOT G1Voeux SUBPROCESS (SPECIFIC Ŋ1 COPY)
##############################################################
${MY_PATH}/VOEUX.refresh.sh "$PLAYER" "$MOATS" ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
${MY_PATH}/VOEUX.refresh.sh "${PLAYER}" "$MOATS" ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html
##############################################################
##################################
@ -155,7 +156,8 @@ for PLAYER in ${PLAYERONE[@]}; do
TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
[[ ! $FEEDNS ]] && FEEDNS=$(ipfs key gen "${PLAYER}_feed")
[[ ! $FEEDNS ]] && echo "ERROR ${PLAYER}_feed IPNS KEY NOT FOUND - ERROR" && continue
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-name","text":"'${PLAYER}_feed'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-name.json
echo '[{"title":"$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key","text":"'${FEEDNS}'","tags":""}]' > ~/.zen/tmp/${MOATS}/lightbeam-key.json
@ -185,34 +187,34 @@ for PLAYER in ${PLAYERONE[@]}; do
## ANY CHANGES ?
##############################################################
DIFF=$(diff ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html)
DIFF=$(diff ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html)
if [[ $DIFF ]]; then
echo "DIFFERENCE DETECTED !! "
echo "Backup & Upgrade TW local copy..."
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/index.html ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
[[ -s ~/.zen/game/players/$PLAYER/ipfs/moa/.chain ]] \
&& ZCHAIN=$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.chain) \
&& echo "# CHAIN : $CURCHAIN -> $ZCHAIN" \
&& sed -i "s~$CURCHAIN~$ZCHAIN~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
[[ -s ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain ]] \
&& ZCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain) \
&& echo "# CHAIN : ${CURCHAIN} -> ${ZCHAIN}" \
&& sed -i "s~${CURCHAIN}~${ZCHAIN}~g" ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html
fi
##############################################################
##################################################
##################################################
################## UPDATING PLAYER MOA
[[ $DIFF ]] && cp ~/.zen/game/players/$PLAYER/ipfs/moa/.chain \
~/.zen/game/players/$PLAYER/ipfs/moa/.chain.$(cat ~/.zen/game/players/$PLAYER/ipfs/moa/.moats)
[[ $DIFF ]] && cp ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain \
~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats)
TW=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1)
ipfs name publish --allow-offline -t 24h --key=$PLAYER /ipfs/$TW
TW=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html | tail -n 1)
ipfs name publish --allow-offline -t 24h --key=${PLAYER} /ipfs/$TW
[[ $DIFF ]] && echo $TW > ~/.zen/game/players/$PLAYER/ipfs/moa/.chain
echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/moa/.moats
[[ $DIFF ]] && echo $TW > ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain
echo $MOATS > ~/.zen/game/players/${PLAYER}/ipfs/moa/.moats
echo "================================================"
echo " MAJ TW $PLAYER : = /ipfs/$TW"
echo " $myIPFSGW/ipns/$ASTRONAUTENS"
echo " MAJ TW ${PLAYER} : = /ipfs/$TW"
echo " $myIPFSGW/ipns/${ASTRONAUTENS}"
echo "================================================"
######################### PLAYER_feed
@ -221,13 +223,13 @@ for PLAYER in ${PLAYERONE[@]}; do
echo "IFRIENDHEAD :" ${IFRIENDHEAD}
echo "(☉_☉ ) (☉_☉ ) (☉_☉ )"
# cp -f ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ~/.zen/game/players/$PLAYER/FRIENDS/${FPLAYER}.rss.json
# cp -f ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ~/.zen/game/players/${PLAYER}/FRIENDS/${FPLAYER}.rss.json
[[ -d ~/.zen/game/players/$PLAYER/FRIENDS ]] \
&& cat ${MY_PATH}/../www/iframe.html | sed "s~_ME_~/ipns/${ASTRONAUTENS}~g" | sed "s~_IFRIENDHEAD_~${IFRIENDHEAD}~g" > ~/.zen/game/players/$PLAYER/FRIENDS/index.html
[[ -d ~/.zen/game/players/${PLAYER}/FRIENDS ]] \
&& cat ${MY_PATH}/../www/iframe.html | sed "s~_ME_~/ipns/${ASTRONAUTENS}~g" | sed "s~_IFRIENDHEAD_~${IFRIENDHEAD}~g" > ~/.zen/game/players/${PLAYER}/FRIENDS/index.html
[[ -s ~/.zen/game/players/$PLAYER/FRIENDS/index.html ]] \
&& FRAME=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/FRIENDS/index.html | tail -n 1) \
[[ -s ~/.zen/game/players/${PLAYER}/FRIENDS/index.html ]] \
&& FRAME=$(ipfs add -Hq ~/.zen/game/players/${PLAYER}/FRIENDS/index.html | tail -n 1) \
&& ipfs name publish --key="${PLAYER}_feed" /ipfs/$FRAME
done

View File

@ -117,9 +117,8 @@ select fav in "${choices[@]}"; do
espeak "Droping TW in cyber space"
ipfs key rm ${PLAYER}; ipfs key rm ${PLAYER}_feed; ipfs key rm $G1PUB;
for voeu in $(ls ~/.zen/game/players/$PLAYER/voeux/*/ 2>/dev/null); do
echo "ipfs key rm $voeu"
ipfs key rm $voeu
for vk in $(ls -d ~/.zen/game/players/${PLAYER}/voeux/*/* | rev | cut -d / -f 1 | rev); do
ipfs key rm $vk
done
## UNPLUG PLAYER DOCKER

View File

@ -27,7 +27,7 @@ PASS=$(cat ~/.zen/game/players/${PLAYER}/.pass)
source ~/.zen/game/players/${PLAYER}/secret.june
[[ $SALT == "" ]] && echo "BAD ACCOUNT. PLEASE BACKUP. MOVE. RESTORE." && exit 1
LP=$(ls /dev/usb/lp*)
LP=$(ls /dev/usb/lp* 2>/dev/null)
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-7)
@ -61,39 +61,51 @@ mv ~/.zen/G1BILLET/tmp/g1billet/$PASS/$BILLETNAME.BILLET.jpg ~/.zen/tmp/$PASS.jp
#~ "$DISCO"
#~ ## ADD PLAYER EMAIL
#~ convert -gravity southeast -pointsize 28 -fill black -draw "text 5,3 \"$EMAIL\"" ~/.zen/tmp/fond_qrcode.png ~/.zen/tmp/${PASS}.TW.png
convert -gravity SouthEast -pointsize 12 -fill black -draw "text 5,3 \"$EMAIL\"" ~/.zen/G1BILLET/tmp/fond_qrcode.png ~/.zen/tmp/${PASS}.G1PASS.png
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open ~/.zen/G1BILLET/tmp/fond_qrcode.png
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open ~/.zen/tmp/${PASS}.G1PASS.png
## PRINT STICKER
[[ $LP ]] \
&& brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/${PASS}.G1PASS.png > ~/.zen/tmp/bill.bin 2>/dev/null \
&& sudo brother_ql_print ~/.zen/tmp/bill.bin $LP
#############
convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 320 ~/.zen/tmp/QR.png
convert ${MY_PATH}/../images/astroport.jpg -resize 220 ~/.zen/tmp/ASTROPORT.png
brother_ql_create --model QL-700 --label-size 62 ~/.zen/G1BILLET/tmp/fond_qrcode.png > ~/.zen/tmp/bill.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/bill.bin $LP
convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 300 ~/.zen/tmp/QR.png
convert ${MY_PATH}/../images/astroport.jpg -resize 300 ~/.zen/tmp/ASTROPORT.png
composite -compose Over -gravity SouthWest -geometry +280+20 ~/.zen/tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/ASTROPORT.png ${MY_PATH}/../images/Brother_600x400.png ~/.zen/tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 ~/.zen/tmp/QR.png ~/.zen/tmp/astroport.png ~/.zen/tmp/one.png
# composite -compose Over -gravity NorthWest -geometry +280+280 ~/.zen/game/players/${PLAYER}/QRsec.png ~/.zen/tmp/one.png ~/.zen/tmp/image.png
convert -gravity northwest -pointsize 35 -fill black -draw "text 50,300 \"$PSEUDO\"" ~/.zen/tmp/one.png ~/.zen/tmp/image.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 300,40 \"$PLAYER\"" ~/.zen/tmp/image.png ~/.zen/tmp/pseudo.png
convert -gravity northeast -pointsize 25 -fill black -draw "text 20,180 \"$PASS\"" ~/.zen/tmp/pseudo.png ~/.zen/tmp/pass.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,100 \"$SALT\"" ~/.zen/tmp/pass.png ~/.zen/tmp/salt.png
convert -gravity northwest -pointsize 25 -fill black -draw "text 300,140 \"$PEPPER\"" ~/.zen/tmp/salt.png ~/.zen/tmp/done.jpg
convert -gravity NorthWest -pointsize 25 -fill black -draw "text 10,300 \"$PLAYER\"" ~/.zen/tmp/one.png ~/.zen/tmp/image.png
convert -gravity NorthWest -pointsize 15 -fill black -draw "text 20,2 \"$G1PUB\"" ~/.zen/tmp/image.png ~/.zen/tmp/pseudo.png
convert -gravity NorthWest -pointsize 20 -fill black -draw "text 400,260 \"$PASS\"" ~/.zen/tmp/pseudo.png ~/.zen/tmp/pass.png
convert -gravity NorthWest -pointsize 15 -fill black -draw "text 300,200 \"$SALT\"" ~/.zen/tmp/pass.png ~/.zen/tmp/salt.png
convert -gravity NorthWest -pointsize 15 -fill black -draw "text 300,220 \"$PEPPER\"" ~/.zen/tmp/salt.png ~/.zen/tmp/done.jpg
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/done.jpg > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open ~/.zen/tmp/done.jpg
[[ $LP ]] \
&& brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/done.jpg > ~/.zen/tmp/toprint.bin 2>/dev/null \
&& sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
################################################################
### PRINT PLAYER TW myIP link
playerns=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
qrencode -s 12 -o "$HOME/.zen/tmp/QR.ASTRO.png" "$myIPFSGW/ipns/$playerns"
convert $HOME/.zen/tmp/QR.ASTRO.png -resize 600 ~/.zen/tmp/playerns.png
#~ playerns=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1)
#~ qrencode -s 12 -o "$HOME/.zen/tmp/QR.ASTRO.png" "$myIPFSGW/ipns/$playerns"
#~ convert $HOME/.zen/tmp/QR.ASTRO.png -resize 600 ~/.zen/tmp/playerns.png
## GET FROM G1BILLET CACHE FACTORY
[[ $XDG_SESSION_TYPE == 'x11' ]] && xdg-open ~/.zen/G1BILLET/tmp/${PASS}/300.png
brother_ql_create --model QL-700 --label-size 62 ~/.zen/tmp/playerns.png > ~/.zen/tmp/toprint.bin 2>/dev/null
sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
[[ $LP ]] \
&& brother_ql_create --model QL-700 --label-size 62 ~/.zen/G1BILLET/tmp/${PASS}/300.png > ~/.zen/tmp/toprint.bin 2>/dev/null \
&& sudo brother_ql_print ~/.zen/tmp/toprint.bin $LP
################################################################
## TODO BETTER CACHE CLEANING
#~ rm -Rf ~/.zen/G1BILLET/tmp/${PASS}
#~ rm ~/.zen/G1BILLET/tmp/${PASS}*
#~ rm ~/.zen/tmp/${PASS}*
exit 0