From 916f119a09b57c14a999ab52436000d8980176c8 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 16 Feb 2024 13:07:53 +0100 Subject: [PATCH] ${MY_PATH}/ping_bootstrap.sh --- 20h12.process.sh | 49 +++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/20h12.process.sh b/20h12.process.sh index 5b973c73..6035e56d 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -15,7 +15,9 @@ LOWMODE=$(sudo systemctl status ipfs | grep disabled) ## IPFS DISABLED - START O [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]] && LOWMODE="NO 5001" ## IPFS IS STOPPED [[ ! $isLAN ]] && LOWMODE="" ## LOWMODE ONLY FOR LAN STATION # echo "$USER ALL=(ALL) NOPASSWD:/bin/systemctl" | (sudo su -c 'EDITOR="tee" visudo -f /etc/sudoers.d/systemctl') + sudo systemctl restart ipfs && sleep 10 + floop=0 while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do sleep 10 @@ -24,7 +26,9 @@ while [[ ! $(netstat -tan | grep 5001 | grep LISTEN) ]]; do && ${MY_PATH}/tools/mailjet.sh "support@qo-op.com" "/tmp/20h12.log" "IPFS RESTART ERROR 20H12" \ && exit 1 done -# espeak "CODE git pull" > /dev/null 2>&1 + +## PING BOOSTRAP & SWARM NODES +${MY_PATH}/ping_bootstrap.sh # show ZONE.sh cache of the day ls ~/.zen/tmp/ZONE_* @@ -42,7 +46,7 @@ mv ~/.zen/coucou ~/.zen/tmp/coucou && rm -Rf ~/.zen/G1BILLET/tmp/* ## UPDATE Astroport.ONE code -cd ~/.zen/Astroport.ONE/ +cd ${MY_PATH}/ git pull ## SOON /ipns/ Address !!! @@ -52,26 +56,32 @@ git pull ${MY_PATH}/youtube-dl.sh sudo youtube-dl -U -# Refresh ~/.zen/game/world/G1VOEU -# NOW RUN FROM PLAYER.refresh.sh !! ~/.zen/Astroport.ONE/RUNTIME/VOEUX.refresh.sh +## PING BOOSTRAP & SWARM NODES +${MY_PATH}/ping_bootstrap.sh +##################################### # espeak "Players refresh" > /dev/null 2>&1 # Refresh ~/.zen/game/players/PLAYER -~/.zen/Astroport.ONE/RUNTIME/PLAYER.refresh.sh - +##################################### +${MY_PATH}/RUNTIME/PLAYER.refresh.sh +##################################### +##################################### # espeak "REFRESHING UPLANET" > /dev/null 2>&1 -~/.zen/Astroport.ONE/RUNTIME/UPLANET.refresh.sh - +##################################### +${MY_PATH}/RUNTIME/UPLANET.refresh.sh +##################################### +##################################### # espeak "REFRESHING NODE" > /dev/null 2>&1 -~/.zen/Astroport.ONE/RUNTIME/NODE.refresh.sh - +##################################### +${MY_PATH}/RUNTIME/NODE.refresh.sh +##################################### ## if [[ ! $isLAN ]]; then ## REFRESH BOOSTRAP LIST (OFFICIAL SWARM) espeak "bootstrap refresh" > /dev/null 2>&1 ipfs bootstrap rm --all > /dev/null 2>&1 - for bootnode in $(cat ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | grep -Ev "#") # remove comments + for bootnode in $(cat ${MY_PATH}/A_boostrap_nodes.txt | grep -Ev "#") # remove comments do ipfsnodeid=${bootnode##*/} ipfs bootstrap add $bootnode @@ -104,9 +114,9 @@ espeak "DURATION ${hours} hours ${minutes} minutes ${seconds} seconds" > /dev/nu ## KILL ALL REMAINING nc killall nc 12345.sh > /dev/null 2>&1 -## OPEN API ENGINE +## SYSTEMD OR NOT SYSTEMD if [[ ! -f /etc/systemd/system/astroport.service ]]; then - ~/.zen/Astroport.ONE/12345.sh > ~/.zen/tmp/12345.log & + ${MY_PATH}/12345.sh > ~/.zen/tmp/12345.log & PID=$! echo $PID > ~/.zen/.pid else @@ -116,17 +126,22 @@ else fi -echo "IPFS LOW MODE ?" +echo "IPFS DAEMON LEVEL" +######### IPFS DAMEON NOT RUNNING ALL DAY ## IF IPFS DAEMON DISABLED : WAIT 1H & STOP IT [[ $LOWMODE != "" ]] \ - && echo "ON. $LOWMODE" \ - && sleep 360 \ + && echo "STOP IPFS $LOWMODE" \ + && sleep 3600 \ && sudo systemctl stop ipfs \ && exit 0 -echo "OFF. RESTART IPFS" +echo "HIGH. RESTART IPFS" sleep 60 sudo systemctl restart ipfs + +################################# +### DRAGON WOT : SSH P2P RING OPENING +################################# sleep 30 ${MY_PATH}/RUNTIME/DRAGON_p2p_ssh.sh