Last line is the selected one

This commit is contained in:
fred 2024-04-16 16:12:40 +02:00
parent 05c171dd97
commit 07f3ab165f
3 changed files with 29 additions and 14 deletions

View File

@ -58,9 +58,10 @@ mkdir -p ~/.zen/tmp/${MOATS}
[[ $ONE == "ONE" ]] && ALL=1
[[ $ALL == "ALL" ]] && SECTORG1PUB=${WORLDG1PUB} && echo "DEST = WORLDG1PUB: ${WORLDG1PUB}"
YOUSER=$(${MY_PATH}/../tools/clyuseryomail.sh ${PLAYER})
[[ ! -z ${SECTORG1PUB} ]] \
&& echo "> PAY4SURE ZEN:${ALL} WALLET MOVE" \
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UNPLUG:${ALL}"
&& ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "${ALL}" "${SECTORG1PUB}" "UPLANET:UNPLUG:${YOUSER}:${ALL}"
## REMOVING PLAYER from ASTROPORT
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub)

View File

@ -293,7 +293,7 @@ for UMAP in ${unique_combined[@]}; do
####################################################################################
## TODATE DATA
echo "WRITE $TODATE DATA /UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}"
echo "WRITE $TODATE DATA ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}"
####################################################################################
echo "${TODATENS}" \
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/TODATENS
@ -309,6 +309,7 @@ for UMAP in ${unique_combined[@]}; do
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/REGIONG1PUB
####################################################################################
ls ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${RLAT}_${RLON}/_${SLAT}_${SLON}/_${LAT}_${LON}/
# %%%%%%%%%% ##################################################
## COLLECT RSS FROM ALL PLAYERS WITH SAME UMAP IN SWARM MEMORY /UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??
@ -507,7 +508,7 @@ for UMAP in ${unique_combined[@]}; do
ZMOATS=$(cat ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_moats 2>/dev/null)
[[ ${ZCHAIN} && ${ZMOATS} ]] \
&& cp ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain ~/.zen/tmp/${MOATS}/${UMAP}/${G1PUB}:ZEN/_chain.${ZMOATS} \
&& echo "UPDATING MOATS"
&& echo "UPDATING MOATS=${MOATS}"
######################################################
## ZEN CHAINING

View File

@ -67,6 +67,7 @@ if [[ ! -f $DIR/duniter_nodes.txt ]]; then
# Get New BMAS known Nodes list from shuffle one $DIR/good.nodes.txt
[[ -f $DIR/good.nodes.txt ]] && DUNITER=$(shuf -n 1 $DIR/good.nodes.txt) || DUNITER="g1.copylaradio.com:443"
curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep GVA | awk '{print $3,$4}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g | sort -u > $DIR/duniter_nodes.txt
[[ "$1" == "BMAS" ]] && curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep BMAS | awk '{print $2,$3}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g | sort -u > $DIR/duniter_nodes.txt
fi
# Grab the nodes we are actively watching - they will be in bold in the final output
@ -82,7 +83,7 @@ rm $DIR/*out $DIR/*done $DIR/chains/* $DIR/NODE.* 2>/dev/null
for node in $nodes
do
#~ echo "checkonenode $node "$watched" $DIR/$index.out"
checkonenode $node "$watched" $DIR/$index.out
checkonenode $node "$watched" $DIR/$index.out &
#~ cat $DIR/$index.out
((index++))
done
@ -117,23 +118,35 @@ cat $DIR/chains/$longchain | shuf > $DIR/good.nodes.txt
Dtest=""; IDtest=""; lastresult=""; loop=0
while read lastresult;
do
## CHECK if server is not too slow
echo "curl -s -m 5 https://$lastresult | jq -r .duniter.software"
Dtest=$(curl -s -m 5 https://$lastresult | jq -r .duniter.software)
echo "curl -s -m 2 https://$lastresult | jq -r .duniter.software"
Dtest=$(curl -s -m 2 https://$lastresult | jq -r .duniter.software)
echo "$Dtest"
gvaserver=$(echo $lastresult | sed "s~:443~/gva~g" )
[[ "$Dtest" == "duniter" ]] \
&& echo "jaklis -n https://$gvaserver balance -p DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech" \
&& IDtest=$(jaklis -n https://$gvaserver balance -p DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech 2>/dev/null)
echo $IDtest
if [[ "$Dtest" == "duniter" ]]; then
if [[ "$1" == "BMAS" ]]; then
echo "silkaj --endpoint $lastresult wot lookup DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech"
IDtest=$(silkaj --endpoint $lastresult wot lookup DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech)
echo $IDtest
[[ $IDtest != "" && $IDtest != "null" ]] && result="$lastresult" && break
[[ $IDtest != "" && $IDtest != "null" ]] && result="https://$gvaserver" && break
[[ $loop -eq 8 ]] \
&& result="g1.duniter.org" && break
else
gvaserver=$(echo $lastresult | sed "s~:443~/gva~g" )
echo "jaklis -n https://$gvaserver idBalance -p 2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH"
IDtest=$(jaklis -n https://$gvaserver idBalance -p 2L8vaYixCf97DMT8SistvQFeBj7vb6RQL7tvwyiv1XVH 2>/dev/null)
echo $IDtest
[[ $IDtest != "" && $IDtest != "null" ]] && result="https://$gvaserver" && break
[[ $loop -eq 8 ]] \
&& result="https://g1.copylaradio.com/gva" && break
[[ $loop -eq 8 ]] \
&& result="https://g1.copylaradio.com/gva" && break
fi
fi
((loop++))
done < $DIR/good.nodes.txt