This commit is contained in:
fred 2022-10-31 19:06:22 +01:00
parent 00932e4ae1
commit d9af68538e
3 changed files with 9 additions and 5 deletions

View File

@ -329,7 +329,8 @@ cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.inde
(echo "ERROR - NO TW FOUND - ERROR" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && continue
fi
else
echo "***** READER MODE *****"
echo "***** COULD BE READER MODE *****"
fi
sed "s~_TWLINK_~http://$TWIP:8080/ipns/${ASTRONAUTENS}~g" ~/.zen/Astroport.ONE/templates/index.redirect > ~/.zen/tmp/coucou/${MOATS}.index.redirect
@ -344,7 +345,7 @@ cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.inde
## CHECK IF ALREADY EXISTING WHAT
# IF NOT = BATCH CREATE TW
end=`date +%s`
echo Execution time was `expr $end - $start` seconds.
echo $type Execution time was `expr $end - $start` seconds.
fi ## END IF SALT

View File

@ -1,4 +1,7 @@
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET
Server: Astroport
Content-Type: text/html; charset=UTF-8

View File

@ -16,7 +16,7 @@ PLAYER="$3"
PSEUDO="$4"
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
[[ ${PLAYER} ]] && ASTRONAUTENS=$(ipfs key list -l | grep -w "${PLAYER}" | cut -d ' ' -f 1)
[[ $ASTRONAUTENS ]] && echo "IPNS $PLAYER EXISTANT http://$myIP:8080/$ASTRONAUTENS !! DO NOTHING - EXIT -" && exit 0
## Chargement TW !!!
@ -51,7 +51,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
OLDIP=$(cat ~/.zen/tmp/miz.json | jq -r .[].secret)
echo "TW OFFICIAL GATEWAY : http://$OLDIP:8080//ipns/$GNS"
if [[ ! -d ~/.zen/game/players/$PLAYER/ipfs/moa ]]; then
echo "UPDATE LOCAL COPY ~/.zen/game/players/$PLAYER/ipfs/moa"
echo "UPDATE $PLAYER LOCAL COPY ~/.zen/game/players/$PLAYER/ipfs/moa"
[[ "$myIP" == "$OLDIP" ]] && cp ~/.zen/tmp/TW/index.html ~/.zen/game/players/$PLAYER/ipfs/moa/
fi
# DO NOT CONTINUE
@ -94,7 +94,7 @@ PSEUDO=${PSEUDO%%[0-9]*}
# PSEUDO=${PSEUDO,,} #lowercase
[[ ! $PLAYER ]] && PLAYER=${PSEUDO}${RANDOM:0:2}$(${MY_PATH}/diceware.sh 1 | xargs)${RANDOM:0:2} \
&& echo "$PLAYER ! Vous aviez déjà un autre Player ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER
&& echo "$PLAYER ! A quelle adresse email vous joindre ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER
[[ -d ~/.zen/game/players/$PLAYER ]] && echo "FATAL ERROR $PLAYER NAME COLLISION. TRY AGAIN." && exit 1
[[ ! $PSEUDO ]] && PSEUDO=$PLAYER