From 33ead68dd319315f60cdbb414a077845370e07ac Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 31 Oct 2022 02:15:06 +0100 Subject: [PATCH] please check official with _SECRET_ --- 12345.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/12345.sh b/12345.sh index e57c5c06..24ec65db 100755 --- a/12345.sh +++ b/12345.sh @@ -288,17 +288,27 @@ cat ~/.zen/game/players/toctoc/${MOATS}.messaging.json >> ~/.zen/game/players/to if [[ $OLDIP == "_SECRET_" ]]; then echo "_SECRET_ TW PUSHING TW" ## BECOMING OFFICIAL BECOME R/W TW sed -i "s~_SECRET_~${myIP}~g" ~/.zen/game/players/toctoc/${MOATS}.astroindex.html - echo "HTTP/1.1 200 OK -Server: Astroport -Content-Type: text/html; charset=UTF-8 -" > ~/.zen/game/players/toctoc/${MOATS}.index.redirect - cat ~/.zen/game/players/toctoc/${MOATS}.astroindex.html >> ~/.zen/game/players/toctoc/${MOATS}.index.redirect - cat ~/.zen/game/players/toctoc/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & - ## CREATE $PLAYER IPNS KEY (for next 20h12) - ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/toctoc/${MOATS}.${G1PUB}.ipns.key - mkdir -p ~/.zen/game/players/$PLAYER/ipfs/moa - cp ~/.zen/game/players/toctoc/${MOATS}.astroindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html + # cat ~/.zen/game/players/toctoc/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & + + ## CREATE $PLAYER IPNS KEY (for next 20h12) + ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/game/players/toctoc/${MOATS}.${G1PUB}.ipns.key + [[ ! -d ~/.zen/game/players/$PLAYER/ipfs/moa ]] && \ + mv ~/.zen/game/players/toctoc ~/.zen/game/players/$PLAYER + mkdir -p ~/.zen/game/players/$PLAYER/ipfs/moa/ + mv ~/.zen/game/players/$PLAYER/${MOATS}.astroindex.html ~/.zen/game/players/$PLAYER/ipfs/moa/index.html + + echo "## PUBLISHING ${PLAYER} /ipns/$ASTRONAUTENS/" + IPUSH=$(ipfs add -Hq ~/.zen/game/players/$PLAYER/ipfs/moa/index.html | tail -n 1) + echo $IPUSH > ~/.zen/game/players/$PLAYER/ipfs/moa/.chain # Contains last IPFS backup PLAYER KEY + echo "/ipfs/$IPUSH" + echo $MOATS > ~/.zen/game/players/$PLAYER/ipfs/moa/.moats + ipfs name publish --key=${PLAYER} /ipfs/$IPUSH 2>/dev/null + ## MEMORISE PLAYER Ŋ1 ZONE + echo "$PLAYER" > ~/.zen/game/players/$PLAYER/.player + echo "$PSEUDO" > ~/.zen/game/players/$PLAYER/.pseudo + echo "$G1PUB" > ~/.zen/game/players/$PLAYER/.g1pub + continue fi # ACTIVE GATEWAY