this is better

This commit is contained in:
fred 2022-09-13 20:57:11 +02:00
parent df3fd937a1
commit 8977e583a5
2 changed files with 5 additions and 2 deletions

View File

@ -145,7 +145,7 @@ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://'$myIP'
composite -compose Over -gravity NorthWest -geometry +350+10 /tmp/ASTROLOGO.png ${MY_PATH}/images/Brother_600x400.png /tmp/astroport.png
composite -compose Over -gravity NorthWest -geometry +0+0 /tmp/QRWISHLINK.png /tmp/astroport.png /tmp/one.png
convert -gravity northwest -pointsize 35 -fill black -draw "text 320,250 \"$PSEUDO\"" /tmp/one.png /tmp/hop.png
convert -gravity northwest -pointsize 35 -fill black -draw "text 320,250 \"$PLAYER\"" /tmp/one.png /tmp/hop.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 20,320 \"$PEPPER\"" /tmp/hop.png /tmp/pseudo.png
convert -gravity northwest -pointsize 30 -fill black -draw "text 320,300 \"$SALT\"" /tmp/pseudo.png /tmp/salt.png
convert -gravity northwest -pointsize 33 -fill black -draw "text 320,350 \"$PEPPER\"" /tmp/salt.png /tmp/player.png

View File

@ -18,10 +18,11 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
ASTRO=""
echo "$SALT"
echo "$PEPPER"
ipfs key rm gchange
ipfs key rm gchange 2>/dev/null
rm -f ~/.zen/tmp/gchange.key
${MY_PATH}/keygen -t ipfs -o ~/.zen/tmp/gchange.key "$SALT" "$PEPPER"
GNS=$(ipfs key import gchange -f pem-pkcs8-cleartext ~/.zen/tmp/gchange.key )
echo "/ipns/$GNS"
mkdir -p ~/.zen/tmp/TW
rm -f ~/.zen/tmp/TW/index.html
@ -72,9 +73,11 @@ echo "-> SALT : $SALT"
echo "-> PEPPER : $PEPPER"
PSEUDO=${PLAYER%%[0-9]*}
[[ ! $PSEUDO ]] && echo "Choisissez un pseudo : " && read PSEUDO; PSEUDO=${PSEUDO,,}; PSEUDO=${PSEUDO%%[0-9]*} && [[ $(ls ~/.zen/game/players/$PSEUDO* 2>/dev/null) ]] && echo "CE PSEUDO EST DEJA UN PLAYER. EXIT" && exit 1
# PSEUDO=${PSEUDO,,} #lowercase
[[ ! $PLAYER ]] && PLAYER=${PSEUDO}${RANDOM:0:2}$(${MY_PATH}/diceware.sh 1 | xargs)${RANDOM:0:2}
[[ $ASTRO ]] && echo "$PLAYER ! Vous aviez déjà un autre Player ?" && read OPLAYER && [[ $OPLAYER ]] && PLAYER=$OPLAYER
[[ -d ~/.zen/game/players/$PLAYER ]] && echo "FATAL ERROR $PLAYER NAME COLLISION. TRY AGAIN." && exit 1
[[ ! $PSEUDO ]] && PSEUDO=$PLAYER