This commit is contained in:
fred 2024-01-05 17:58:09 +01:00
parent ad8cfdaf27
commit c94d8ac11d
2 changed files with 56 additions and 51 deletions

View File

@ -157,8 +157,7 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
echo "COINScheck.sh ${G1PUB}" echo "COINScheck.sh ${G1PUB}"
${MY_PATH}/../tools/COINScheck.sh ${G1PUB} > ~/.zen/tmp/${G1PUB}.curcoin ${MY_PATH}/../tools/COINScheck.sh ${G1PUB} > ~/.zen/tmp/${G1PUB}.curcoin
cat ~/.zen/tmp/${G1PUB}.curcoin CURCOINS=$(cat ~/.zen/tmp/${G1PUB}.curcoin | tail -n 1 | cut -d '.' -f 1)
CURCOINS=$(cat ~/.zen/tmp/${G1PUB}.curcoin | tail -n 1 | cut -d '.' -f 1) ## ROUNDED G1 COIN
CURZEN=$(echo "($CURCOINS - 1) * 10" | bc | cut -d '.' -f 1) CURZEN=$(echo "($CURCOINS - 1) * 10" | bc | cut -d '.' -f 1)
echo "= $CURCOINS G1 / $CURZEN ZEN" echo "= $CURCOINS G1 / $CURZEN ZEN"
@ -265,7 +264,7 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
( (
echo "$HTTPCORS echo "$HTTPCORS
LOGIN ERROR<br>Could not find PLAYER on ZEN Station" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 \ LOGIN ERROR<br>Could not find PLAYER on ZEN Station" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 \
&& echo "ERROR PLAYER SLURP" && echo "SLURP PLAYER ERROR ${player}"
) & ) &
exit 0 exit 0
fi fi
@ -341,7 +340,7 @@ if [[ ${QRCODE:0:5} == "~~~~~" ]]; then
( (
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP ~~ $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0
@ -558,7 +557,7 @@ if [[ ${QRCODE:0:5} == "@@@@@" ]]; then
( (
cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 cat ~/.zen/tmp/${MOATS}/disco | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP @@ $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0
@ -597,7 +596,7 @@ if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then
cat ~/.zen/tmp/${MOATS}/g1voeu.json >> ~/.zen/tmp/${MOATS}/index.redirect cat ~/.zen/tmp/${MOATS}/g1voeu.json >> ~/.zen/tmp/${MOATS}/index.redirect
( (
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP g1voeu.json $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0
@ -634,7 +633,7 @@ if [[ ${QRCODE:0:2} == "G1" && ${AND} == "tw" ]]; then
echo "url='"${LINK}"'" >> ~/.zen/tmp/${MOATS}/index.redirect echo "url='"${LINK}"'" >> ~/.zen/tmp/${MOATS}/index.redirect
( (
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP ${LINK} $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0
fi fi
@ -646,10 +645,11 @@ QRCODE="${QRCODE%%:*}" ## TRIM :ZEN :ChK
################################################################################ ################################################################################
################################################################################ ################################################################################
## QRCODE IS IPNS FORMAT "12D3Koo" ( try ipfs_to_g1 ) ## QRCODE IS IPNS FORMAT "12D3Koo" ( try ipfs_to_g1 )
IPNS2G1=$(${MY_PATH}/../tools/ipfs_to_g1.py ${QRCODE} 2>/dev/null) IPNS2G1=$(${MY_PATH}/../tools/ipfs_to_g1.py ${QRCODE} 2>/dev/null) ## NOT SURE. works on any string ;)
[[ ${IPNS2G1} != "" ]] \ [[ ${ZCHK} == "" && ${#IPNS2G1} -ge 40 && ${QRCODE::4} == "12D3" ]] \
&& echo "${PORT} QRCODE IS IPNS ADDRESS : ${myIPFS}/ipns/${QRCODE}" \ && echo "${PORT} QRCODE IS IPNS ADDRESS : ${myIPFS}/ipns/${QRCODE}" \
&& (echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}/ipns/${QRCODE}'\" />Loading from IPFS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \ && (echo "$HTTPCORS <meta http-equiv=\"refresh\" content=\"0; url='${myIPFS}/ipns/${QRCODE}'\" />Loading from IPFS" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "PRULS /ipns/${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 0 && exit 0
## TEST G1 TYPE ( try g1_to_ipfs ) ## TEST G1 TYPE ( try g1_to_ipfs )
@ -657,6 +657,7 @@ ASTROTOIPNS=$(${MY_PATH}/../tools/g1_to_ipfs.py ${QRCODE} 2>/dev/null)
[[ ! ${ASTROTOIPNS} ]] \ [[ ! ${ASTROTOIPNS} ]] \
&& echo "${PORT} INVALID QRCODE : ${QRCODE}" \ && echo "${PORT} INVALID QRCODE : ${QRCODE}" \
&& (echo "$HTTPCORS ERROR - INVALID QRCODE : ${QRCODE}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \ && (echo "$HTTPCORS ERROR - INVALID QRCODE : ${QRCODE}" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) \
&& echo "PRULS INVALID ${QRCODE} $PORT" && rm -Rf ~/.zen/tmp/${MOATS} \
&& exit 1 && exit 1
################################################################################ ################################################################################
echo "############################################################################" echo "############################################################################"
@ -680,19 +681,20 @@ if [[ $VISITORCOINS == "null" ]]; then
echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}/index.redirect echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}/index.redirect
echo "<h1>EMPTY. PLEASE CHARGE. </h1> echo "<h1>EMPTY. PLEASE CHARGE. </h1>
... Send dotation to made-in-zen ? Contact <a href='mailto:support@qo-op.com'>support</a> ... Send ZEN ? Contact <a href='mailto:support@qo-op.com'>support</a>
($myHOST)" >> ~/.zen/tmp/${MOATS}/index.redirect ($myHOST)" >> ~/.zen/tmp/${MOATS}/index.redirect
( (
cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP null ZEN $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0
fi fi
## WE SEND WALLET AMOUNT DISPLAY
( (
echo "$HTTPCORS <h2>${ZCHK} : ${QRCODE}</h2><h1>${DISPLAY}</h1>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 echo "$HTTPCORS <h2>${ZCHK} : ${QRCODE}</h2><h1>${DISPLAY}</h1>" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1
echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} echo "BLURP ${DISPLAY} $PORT" && rm -Rf ~/.zen/tmp/${MOATS}
) & ) &
exit 0 exit 0

View File

@ -58,7 +58,8 @@ tiddlywiki --load ${INDEX} --output ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1vo
[[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] && echo "AUCUN G1VOEU - EXIT -" && exit 0 [[ ! -s ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json ]] && echo "AUCUN G1VOEU - EXIT -" && exit 0
cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
echo $(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt | wc -l)" VOEUX : ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt " wishnumbers=$(cat ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt | wc -l)
echo "${wishnumbers} VOEUX : ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt "
## ${PLAYER}.g1wishes.txt contains all TW G1PUB : IPNS key name ## ${PLAYER}.g1wishes.txt contains all TW G1PUB : IPNS key name
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
@ -266,6 +267,7 @@ done < ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt
################################################ ################################################
### SEND GRATITUDE TO SECTOR ### SEND GRATITUDE TO SECTOR
## GET "GPS" TIDDLER ## GET "GPS" TIDDLER
if [[ ${wishnumbers} -gt 0 ]]; then
tiddlywiki --load ${INDEX} \ tiddlywiki --load ${INDEX} \
--output ~/.zen/tmp/${MOATS} \ --output ~/.zen/tmp/${MOATS} \
--render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler --render '.' 'GPS.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'GPS' ## GPS Tiddler
@ -292,6 +294,7 @@ to ${SECTOR} WALLET ${SECTORG1PUB}"
echo "************************************************************" echo "************************************************************"
MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS MYWISHFLUX=$(ipfs add -qHwr ~/.zen/tmp/${IPFSNODEID}/WISH/${PLAYER}/g1voeu/* | tail -n 1) # ADDING JSONS TO IPFS
${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "IPFS:${MYWISHFLUX}" ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${G1AMOUNT}" "${SECTORG1PUB}" "IPFS:${MYWISHFLUX}"
fi
################################################ ################################################
################################################ GRATITUDE SENT TO SECTOR ################################################ GRATITUDE SENT TO SECTOR