diff --git a/12345.sh b/12345.sh index afadfd74..4257b79a 100755 --- a/12345.sh +++ b/12345.sh @@ -277,16 +277,18 @@ sed -i "s~.000.~.$(printf '%03d' $(echo ${RANDOM} % 18 | bc)).~g" ~/.zen/tmp/cou [[ $isLAN ]] && WAIT=3 || WAIT=6 echo "1ST TRY : ipfs --timeout ${WAIT}s cat /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT}" ipfs --timeout ${WAIT}s cat /ipfs/$DATAID > ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT} + echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh if [[ ! -s ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT} ]]; then echo "IPFS TIMEOUT >>> (°▃▃°) $DATAID STILL MISSING GATEWAY BANGING FOR IT (°▃▃°)" - array=(https://tube.copylaradio.com/ipfs/:hash https://ipns.co/:hash https://dweb.link/ipfs/:hash https://ipfs.yt/ipfs/:hash https://ipfs.io/ipfs/:hash https://ipfs.fleek.co/ipfs/:hash https://ipfs.best-practice.se/ipfs/:hash https://gateway.pinata.cloud/ipfs/:hash https://gateway.ipfs.io/ipfs/:hash https://cf-ipfs.com/ipfs/:hash https://cloudflare-ipfs.com/ipfs/:hash) + array=(https://tube.copylaradio.com/ipfs/:hash https://ipns.co/:hash https://dweb.link/ipfs/:hash https://ipfs.io/ipfs/:hash https://ipfs.fleek.co/ipfs/:hash https://ipfs.best-practice.se/ipfs/:hash https://gateway.pinata.cloud/ipfs/:hash https://gateway.ipfs.io/ipfs/:hash https://cf-ipfs.com/ipfs/:hash https://cloudflare-ipfs.com/ipfs/:hash) # size=${#array[@]}; index=$(($RANDOM % $size)); echo ${array[$index]} ## TODO CHOOSE RANDOM # official ipfs best gateway from https://luke.lol/ipfs.php for nicegw in ${array[@]}; do + [[ $(cat ~/.zen/tmp/.ipfsgw.bad.twt | grep -w $nicegw) ]] && echo "<<< BAD GATEWAY >>> $nicegw" && continue gum=$(echo "$nicegw" | sed "s~:hash~$DATAID~g") echo "LOADING $gum" @@ -294,27 +296,34 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh [[ $? != 0 ]] && echo "(✜‿‿✜) $nicegw BYPASSING"; echo if [[ -s ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT} ]]; then - MIME=$(mimetype -b ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT}) - GOAL=$(ipfs add ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT}) - if [[ ${GOAL} != ${DATAID} ]]; then - echo " (╥☁╥ ) - $nicegw ${WHAT} FORMAT ERROR - (╥☁╥ )" - ipfs pin rm /ipfs/${GOAL} - # NOT A JSON AVOID BANISHMENT - echo $nicegw >> ~/.zen/tmp/.ipfsgw.bad.twt + MIME=$(mimetype -b ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT}) + GOAL=$(ipfs add -q ~/.zen/tmp/${IPFSNODEID}/${ASTRONAUTENS}/${APPNAME}/${MOATS}.data.${WHAT}) + + if [[ ${GOAL} != ${DATAID} ]]; then + echo " (╥☁╥ ) - $nicegw ${WHAT} FORMAT ERROR - (╥☁╥ )" + ipfs pin rm /ipfs/${GOAL} + # NOT A JSON AVOID BANISHMENT + echo $nicegw >> ~/.zen/tmp/.ipfsgw.bad.twt + continue + + else + ## GOT IT !! IPFS ADD + ipfs pin add /ipfs/${GOAL} + ## + TW ADD (new_file_in_astroport.sh) + + echo "(♥‿‿♥) $nicegw OK"; echo + break + + fi + + echo " (⇀‿‿↼) - $nicegw TIMEOUT - (⇀‿‿↼)" continue - else - ## GOT IT !! IPFS ADD - ipfs pin add /ipfs/${GOAL} - ## + TW ADD - echo "(♥‿‿♥) $nicegw OK"; echo - break - fi - echo " (⇀‿‿↼) - $nicegw TIMEOUT - (⇀‿‿↼)" - continue + fi done + fi ## NO DIRECT IPFS - GATEWAY TRY ## REALLY NO FILE FOUND !!! diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 1a1a0bed..c14053a6 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -35,7 +35,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 in keystore or Missing $COINS G1 --" && ASTRONAUTENS=$ASTRONS + [[ ! $ASTRONAUTENS ]] && echo "WARNING No $PLAYER in keystore --" && ASTRONAUTENS=$ASTRONS ## VISA EMITER STATION MUST ACT ONLY [[ ! -f ~/.zen/game/players/$PLAYER/enc.secret.dunikey ]] && echo "$PLAYER IPNS KEY NOT MINE CONTINUE -- " \ diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index d2e56ad6..62d15d7c 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -77,7 +77,7 @@ do ASTRONAUTENS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${liking_me}) echo "===========================" echo "${liking_me} IS LIKING ME" - echo "TW ? http://tube.copylaradio?com:8080/ipns/$ASTRONAUTENS " + echo "TW ? http://tube.copylaradio.com:8080/ipns/$ASTRONAUTENS " ##### CHECKING IF WE LIKE EACH OTHER Ŋ1 LEVEL ################################## JAKLIS LIKING_ME stars diff --git a/tools/cron_VRFY.sh b/tools/cron_VRFY.sh index f49acdc4..a495eb3f 100755 --- a/tools/cron_VRFY.sh +++ b/tools/cron_VRFY.sh @@ -13,7 +13,7 @@ echo ' # qo-op ############# '$MY_PATH/$ME' ######################################################################## -# Activate / Desactivate ASTROPORT 20h12.sh job & IPFS daemon +# Activate / Desactivate ASTROPORT 20h12.process.sh job & IPFS daemon ########################################################################' # Clean rm -f /tmp/mycron /tmp/newcron @@ -26,7 +26,7 @@ crontab -l > /tmp/mycron awk -i inplace -v rmv="SHELL" '!index($0,rmv)' /tmp/mycron awk -i inplace -v rmv="PATH" '!index($0,rmv)' /tmp/mycron -crontest=$(cat /tmp/mycron | grep -F '20h12.sh') +crontest=$(cat /tmp/mycron | grep -F '20h12.process.sh') if [[ ! $crontest ]]; then ## HEADER @@ -34,8 +34,8 @@ if [[ ! $crontest ]]; then [[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron [[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron cat /tmp/mycron >> /tmp/newcron - # ADD 20h12.sh line - echo "12 20 * * * /bin/bash $MY_PATH/../20h12.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron + # ADD 20h12.process.sh line + echo "12 20 * * * /bin/bash $MY_PATH/../20h12.process.sh > /tmp/20h12.log 2>&1" >> /tmp/newcron crontab /tmp/newcron sudo systemctl enable ipfs sudo systemctl start ipfs @@ -46,8 +46,8 @@ else [[ $1 == "ON" ]] && exit 0 [[ ! $(cat /tmp/mycron | grep -F 'SHELL') ]] && echo "SHELL=/bin/bash" > /tmp/newcron [[ ! $(cat /tmp/mycron | grep -F 'PATH') ]] && echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /tmp/newcron - ## REMOVE 20h12.sh line - cat /tmp/mycron | grep -Ev '20h12.sh' >> /tmp/newcron + ## REMOVE 20h12.process.sh line + cat /tmp/mycron | grep -Ev '20h12.process.sh' >> /tmp/newcron crontab /tmp/newcron sudo systemctl stop ipfs sudo systemctl disable ipfs