Astroport.ONE/tools/Connect_PLAYER_To_Gchange.sh

51 lines
3.4 KiB
Bash
Raw Normal View History

2022-06-01 16:17:20 +02:00
#!/bin/bash
2022-08-15 19:07:39 +02:00
# Run After PLAYER.entrance.sh
2022-08-23 16:31:40 +02:00
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
2022-06-01 16:17:20 +02:00
######################################################################### CONNECT PLAYER WITH GCHANGE
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
2022-08-15 19:07:39 +02:00
ASTRONAUTENS=$(ipfs key list -l | grep -w "$PLAYER" | cut -d ' ' -f 1)
2022-06-01 16:17:20 +02:00
########################################################################
echo "CREATING $PLAYER GCHANGE+ PROFILE"
########################################################################
2022-08-24 15:54:09 +02:00
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "https://astroport.com/ipns/$ASTRONAUTENS" #GCHANGE+
2022-08-28 19:09:06 +02:00
[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && echo "Action Manuelle " $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "https://astroport.com/ipns/$ASTRONAUTENS" #GCHANGE+
2022-06-01 16:17:20 +02:00
########################################################################
2022-08-18 18:32:01 +02:00
#echo "CREATING $PLAYER CESIUM+ PROFILE"
2022-06-01 16:17:20 +02:00
########################################################################
2022-08-24 15:54:09 +02:00
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.presles.fr" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+
2022-08-28 19:09:06 +02:00
[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && echo "Action Manuelle " $ $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.presles.fr" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+
2022-06-01 16:17:20 +02:00
########################################################################
########################################################################
echo "BECOME FRIEND with A_boostrap_nodes.txt"
########################################################################
2022-09-13 20:59:08 +02:00
#for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
#do
#if [[ $bootnode != "" ]]; then
# ipfsnodeid=${bootnode##*/}
# g1node=$(~/.zen/astrXbian/zen/tools/ipfs_to_g1.py $ipfsnodeid)
# echo "SENDING STAR TO BOOTSTRAP NODE : $g1node"
# $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" stars -p $g1node -n 1
# ### DELETE
# # jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" unstars -p $g1node
#fi
#done
2022-06-01 16:17:20 +02:00
########################################################################
2022-08-18 03:47:49 +02:00
# echo 'Creating "ipfstryme" message'
2022-06-01 16:17:20 +02:00
########################################################################
2022-08-18 03:47:49 +02:00
# ~/.zen/astrXbian/zen/tools/add_externIP_to_ipfstryme.sh
# [[ $(cat ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr) == "" ]] && echo "IPFS Friendly Swarm Layer rewriting"
2022-06-01 16:17:20 +02:00
2022-08-18 03:47:49 +02:00
exit 0