From fd52a7e0fb8b323da6106d39775ed2148b5597d2 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 12 Mar 2024 11:54:46 +0100 Subject: [PATCH] informative UKey redirect links --- RUNTIME/DRAGON_p2p_ssh.sh | 2 +- RUNTIME/PLAYER.refresh.sh | 2 +- RUNTIME/REGION.refresh.sh | 2 +- RUNTIME/SECTOR.refresh.sh | 2 +- RUNTIME/UPlanetKEYS_refresh.sh | 11 +++++------ 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/RUNTIME/DRAGON_p2p_ssh.sh b/RUNTIME/DRAGON_p2p_ssh.sh index 39058255..690c4b42 100755 --- a/RUNTIME/DRAGON_p2p_ssh.sh +++ b/RUNTIME/DRAGON_p2p_ssh.sh @@ -74,7 +74,7 @@ if [[ ! $(ipfs p2p ls | grep x/ssh-'${IPFSNODEID}') ]]; then ipfs --timeout=10s ping -n 4 /p2p/'${IPFSNODEID}' [[ $? == 0 ]] \ && ipfs p2p forward /x/ssh-'${IPFSNODEID}' /ip4/127.0.0.1/tcp/'${PORT}' /p2p/'${IPFSNODEID}' \ - && ssh '${USER}'@127.0.0.1 -p '${PORT}' + && ssh '${USER}'@127.0.0.1 -p '${PORT}' \ || echo "CONTACT IPFSNODEID FAILED - ERROR -" fi ' > ~/.zen/tmp/${IPFSNODEID}/x_ssh.sh diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index c2f150c2..6fb927bb 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -539,7 +539,7 @@ for PLAYER in ${PLAYERONE[@]}; do mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER} cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/ - echo "" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html + echo "_${LAT}_${LON}" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/_index.html fi diff --git a/RUNTIME/REGION.refresh.sh b/RUNTIME/REGION.refresh.sh index 583d7498..866ff4dc 100755 --- a/RUNTIME/REGION.refresh.sh +++ b/RUNTIME/REGION.refresh.sh @@ -144,7 +144,7 @@ for REGION in ${REGIONS[@]}; do ################################### ## NODE PUBLISH REGION TODATENS LINK - echo "" \ + echo "/_${REGLAT}_${REGLON}" \ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/REGIONS/_${REGLAT}_${REGLON}/_index.html #~ ## DEMO : PREPARE Ask.IA link - PROD will be launched during RUNTIME. diff --git a/RUNTIME/SECTOR.refresh.sh b/RUNTIME/SECTOR.refresh.sh index 8105867f..d993d6d8 100755 --- a/RUNTIME/SECTOR.refresh.sh +++ b/RUNTIME/SECTOR.refresh.sh @@ -366,7 +366,7 @@ for SECTOR in ${SECTORS[@]}; do ################################### ## NODE CACHE SECTOR TODATENS - echo "" \ + echo "_${SLAT}_${SLON}" \ > ~/.zen/tmp/${IPFSNODEID}/UPLANET/SECTORS/_${REGLAT}_${REGLON}/_${SLAT}_${SLON}/_index.html ## TODO FILTER INFORMATION WITH MULTIPLE SIGNATURES (DONE in REGION.refresh.sh) diff --git a/RUNTIME/UPlanetKEYS_refresh.sh b/RUNTIME/UPlanetKEYS_refresh.sh index d9dcdc6b..155f8aa2 100755 --- a/RUNTIME/UPlanetKEYS_refresh.sh +++ b/RUNTIME/UPlanetKEYS_refresh.sh @@ -14,6 +14,11 @@ exec 2>&1 >> ~/.zen/tmp/_12345.log echo "==========================" echo "(◕‿◕ ) ${ME} (◕‿◕ ) " +#~ ## CHECK IF ALREADY MErunning +countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) +[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 + +echo "(◕‿◕ ) ${ME} starting UPlanet Key Scan _______________________________" ## LOCAL LWKEYS=($(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_*.??_*.??/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf )) @@ -31,12 +36,6 @@ echo ${#SKEYS[@]} " swarm SECTORS" RKEYS=($(cat ~/.zen/tmp/swarm/12D*/UPLANET/REGIONS/_*_*/_index.html 2>/dev/null | grep -o "url='/[^']*'"| sed "s/url='\(.*\)'/\1/" | awk -F"/" '{print $3}' | shuf )) echo ${#RKEYS[@]} " swarm REGIONS" -#~ ## CHECK IF ALREADY MErunning -countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|grep' | wc -l) -[[ $countMErunning -gt 2 ]] && echo "$ME already running $countMErunning time" && exit 0 - -echo "(◕‿◕ ) ${ME} starting UPlanet Terraformation _______________________________" - ## COMBINE & SHUFFLE KEYS combined=("${LWKEYS[@]}" "${LSKEYS[@]}" "${LRKEYS[@]}" "${WKEYS[@]}" "${SKEYS[@]}" "${RKEYS[@]}") UKEYS=($(echo "${combined[@]}" | tr ' ' '\n' | sort -u))