diff --git a/cron_MINUTE.sh b/cron_MINUTE.sh index 60c936b..4499b94 100755 --- a/cron_MINUTE.sh +++ b/cron_MINUTE.sh @@ -19,7 +19,7 @@ source $HOME/.profile [[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games" #### CONTROL STATION IPFS DAEMON -IPFSNODEID=$(ipfs --timeout=10s id -f='\n') +IPFSNODEID=$(ipfs --timeout=15s id -f='\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 diff --git a/zen/gchange_INIT.sh b/zen/gchange_INIT.sh index f2d1a4a..343762b 100755 --- a/zen/gchange_INIT.sh +++ b/zen/gchange_INIT.sh @@ -19,7 +19,8 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr # INITIALISATION & CONTROL ######################################################################## YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1); -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') || echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## [[ ! -f ~/.zen/secret.dunikey ]] && echo "Missing ~/.zen/secret.dunikey. EXIT" && exit 1 diff --git a/zen/gchange_IPFS_swarm.sh b/zen/gchange_IPFS_swarm.sh index 7cfeacd..80058e6 100755 --- a/zen/gchange_IPFS_swarm.sh +++ b/zen/gchange_IPFS_swarm.sh @@ -12,7 +12,8 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') || echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 # CLEAN "A_my_swarm.txt" and "A_swarm_map.txt" if [[ $(cat ~/.zen/A_swarm_map.txt | wc -l) -gt 300 ]]; then diff --git a/zen/ipfs_FRIENDS_refresh.sh b/zen/ipfs_FRIENDS_refresh.sh index f7c0683..d29577b 100755 --- a/zen/ipfs_FRIENDS_refresh.sh +++ b/zen/ipfs_FRIENDS_refresh.sh @@ -10,7 +10,8 @@ ME="${0##*/}" YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') || echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## ######################################################################## # This script is controling IPFS swarm diff --git a/zen/ipfs_SWARM_refresh.sh b/zen/ipfs_SWARM_refresh.sh index 3e3b3e5..5cc50f5 100755 --- a/zen/ipfs_SWARM_refresh.sh +++ b/zen/ipfs_SWARM_refresh.sh @@ -12,7 +12,8 @@ countMErunning=$(ps auxf --sort=+utime | grep -w $ME | grep -v -E 'color=auto|gr YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) && [[ ! $YOU ]] && echo "ipfs NOT RUNNING. EXIT" && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) && [[ ! $G1PUB ]] && echo "ERREUR G1PUB. EXIT" && exit 1 -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') || echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## ######################################################################## # This script is controling IPFS swarm diff --git a/zen/ipns_TAG_refresh.sh b/zen/ipns_TAG_refresh.sh index a208b7f..2a64419 100755 --- a/zen/ipns_TAG_refresh.sh +++ b/zen/ipns_TAG_refresh.sh @@ -20,8 +20,8 @@ ME="${0##*/}" ######################################################################## # ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info ######################################################################## -IPFSNODEID=$(ipfs --timeout=20s id -f='\n') || echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 - +IPFSNODEID=$(ipfs --timeout=20s id -f='\n') +[[ ! $IPFSNODEID ]] && echo 'ERROR missing IPFS Node id !! IPFS is not installed !?' && exit 1 ######################################################################## [[ ! -f ~/.zen/secret.dunikey ]] && exit 1 G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)