set better timeout

This commit is contained in:
fred 2021-08-06 00:10:11 +02:00
parent ebd47017c3
commit 704febd7d3
1 changed files with 17 additions and 14 deletions

View File

@ -21,7 +21,8 @@ source $HOME/.profile
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
#### CONTROL STATION IPFS DAEMON
IPFSNODEID=$(ipfs --timeout=15s id -f='<id>\n')
## timeout is fixing ipfs minimum response time, before considering stuck process
IPFSNODEID=$(ipfs --timeout=10s id -f='<id>\n')
[[ ! $IPFSNODEID && -f /etc/sudoers.d/systemctl ]] && echo "IPFS NOT RUNNING" && sudo systemctl restart ipfs && exit 1
[[ ! $IPFSNODEID && "${USER}" == "xbian" ]] && echo "IPFS NOT RUNNING" && sudo service ipfs restart && exit 1
## CONTROL IPFS IS RUNNING OR RESTART
@ -126,18 +127,10 @@ for g1pub in $(ls -t ~/.zen/ipfs/.$IPFSNODEID/FRIENDS/); do [[ $g1pub ]] && ipfs
########################################################################
# astrXbian TestNET (git pull) -> desactivate in release ipfs get codeID
########################################################################
# ACTIVATE 15-17 MN "git pull" update
if [[ $(($minute % 15)) == 0 ]]; then
########## NextCloud.SMS GUILDE STATION ##############
if [[ -e ~/.zen/SMS/ ]];then
# DONE at 20h01 in taurus crontab
# [[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France
/home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh
fi
########## SMS GUILDE STATION ##############
# ACTIVATE 15 MN "git pull" update
if [[ $(($runtime % 15)) == 0 ]]; then
########## DESYNCH SWARM NODE REQUESTS #################
sleep $((1 + RANDOM % 120))
# git reset --hard
git pull
[[ ! $? == 0 ]] && echo "GIT.P2P.LEGAL IS UNREACHABLE"
@ -170,6 +163,16 @@ if [[ $(($minute % 15)) == 0 ]]; then
fi
if [[ $(($minute % 30)) == 0 ]]; then
########## NextCloud.SMS GUILDE STATION ##############
if [[ -e ~/.zen/SMS/ ]];then
# DONE at 20h01 in taurus crontab
# [[ "$timebar" == "18:30" ]] && /home/${YOU}/.zen/SMSAPP/sms/_SEND2GUILDE.sh "BIODYN" ## PREPARE BIODYN GUILDE SMS => 20h30 in France
/home/${YOU}/.zen/SMSAPP/sms_send_tosend.sh
fi
########## SMS GUILDE STATION ##############
fi
# __ __ _____ ____
# __/ // /_/ ___/ ______ __________ ___ / __ \
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
@ -181,8 +184,8 @@ fi
## SYNC GCHANGE EVERY 1 hour runtime
[[ $(($runtime % 60)) == 0 ]] && $MY_PATH/zen/gchange_INIT.sh && $MY_PATH/zen/gchange_IPFS_swarm.sh &
# QUICK SYNC SWARM EVERY 20 minutes +/- 30 sec
[[ $(($runtime % 20)) == 0 ]] && sleep $((1 + RANDOM % 30)) && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh &
# QUICK SYNC SWARM EVERY 20 minutes
[[ $(($runtime % 20)) == 0 ]] && $MY_PATH/zen/ipfs_FRIENDS_refresh.sh &
########################################################################
# ACTIVATE ~/astroport directory monitoring (xbian only)
@ -244,7 +247,7 @@ echo '
#
# MAINTENANCE
'
sleep $((1 + RANDOM % 15)) ### Be careful if random sleep is not activated...
sleep $((1 + RANDOM % 12)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !!
### PEACE & LOVE software is processing... We are HyperWeb people here.
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.