diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 471e9f1f..dfa07fe4 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -38,7 +38,7 @@ for PLAYER in $(ls -t ~/.zen/game/players/); do ## REFRESH ASTRONAUTE TW ASTRONAUTENS=$(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) - [[ ! $ASTRONAUTENS || $COINS -lt 0 ]] && echo "WARNING No $PLAYER IPNS KEY or Missing $COINS G1 --" && ASTRONAUTENS=$ASTRONS + [[ ! $ASTRONAUTENS || $COINS -lt 0 ]] && echo "WARNING No $PLAYER in keystore or Missing $COINS G1 --" && ASTRONAUTENS=$ASTRONS [[ ! $ASTRONAUTENS ]] && echo "Missing $PLAYER IPNS KEY - CONTINUE --" && continue rm -Rf ~/.zen/tmp/${PLAYER} diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index 9dd0426d..a7aa1904 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -16,12 +16,19 @@ INDEX="$1" PLAYER="$2" ## IPNS KEY NAME - G1PUB - PLAYER ... [[ ! $PLAYER ]] && echo "Please provide IPFS publish key" && exit 1 -ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) -[[ ! $ASTRONAUTENS ]] && echo "$PLAYER CLEF IPNS INTROUVABLE - EXIT -" && exit 1 + PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null) + G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null) + ASTRONS=$(cat ~/.zen/game/players/$PLAYER/.playerns 2>/dev/null) + + ## REFRESH ASTRONAUTE TW + ASTRONAUTENS=$(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) + [[ ! $ASTRONAUTENS ]] && echo "WARNING No $PLAYER in keystore --" && ASTRONAUTENS=$ASTRONS + [[ ! $ASTRONAUTENS ]] && echo "Missing $PLAYER IPNS KEY - CONTINUE --" && exit 1 MOATS=$(date -u +"%Y%m%d%H%M%S%4N") -IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID) +IPFSNODEID=$(ipfs id -f='\n') + myIP=$(hostname -I | awk '{print $1}' | head -n 1) isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/") [[ ! $myIP || $isLAN ]] && myIP="127.0.1.1" diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index 49053e12..a998fec1 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -18,8 +18,14 @@ PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null) [[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null) [[ $G1PUB == "" ]] && echo "ERROR G1PUB - EXIT" && exit 1 -ASTRONAUTENS=$(ipfs key list -l | grep -w "$PLAYER" | cut -d ' ' -f 1) -[[ ! $ASTRONAUTENS ]] && echo "ERROR ASTRONAUTENS - EXIT" && exit 1 + PSEUDO=$(cat ~/.zen/game/players/$PLAYER/.pseudo 2>/dev/null) + G1PUB=$(cat ~/.zen/game/players/$PLAYER/.g1pub 2>/dev/null) + ASTRONS=$(cat ~/.zen/game/players/$PLAYER/.playerns 2>/dev/null) + + ## REFRESH ASTRONAUTE TW + ASTRONAUTENS=$(ipfs key list -l | grep $PLAYER | cut -d ' ' -f1) + [[ ! $ASTRONAUTENS ]] && echo "WARNING No $PLAYER in keystore --" && ASTRONAUTENS=$ASTRONS + [[ ! $ASTRONAUTENS ]] && echo "Missing $PLAYER IPNS KEY - CONTINUE --" && exit 1 ## Directory is created, So this script already run once. if [[ ! -d ~/.zen/game/players/$PLAYER/FRIENDS/ ]]; then