IPFS SWARM RENEW

This commit is contained in:
qo-op 2021-05-22 00:40:33 +02:00
parent c2baf3e3bf
commit cadde5cc5b
2 changed files with 12 additions and 13 deletions

View File

@ -122,7 +122,7 @@ if [[ $(($minute % 15)) == 0 ]]; then
isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1) isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
if [[ ! $isIPFSRunning ]]; then if [[ ! $isIPFSRunning ]]; then
[[ -f /etc/sudoers.d/systemctl && $(cat ~/.zen/ipfs/.$IPFSNODEID/.switch) == 1 ]] && sudo systemctl restart ipfs [[ -f /etc/sudoers.d/systemctl && -f ~/.zen/ipfs/.$IPFSNODEID/.switch ]] && sudo systemctl restart ipfs
echo "ERROR! ipfs daemon is not running. EXIT" echo "ERROR! ipfs daemon is not running. EXIT"
exit 1 exit 1
fi fi
@ -256,6 +256,8 @@ echo '
fi fi
#if [[ "$timebar" == "05:05" ]]; then if [[ "$timebar" == "04:05" ]]; then
# ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh & ~/.zen/astrXbian/zen/ipfs_SWARM_renew.sh 3600 ## CUT IPFS FOR ONE HOUR
#fi ## SWITCHING ON
echo "1" > ~/.zen/ipfs/.$IPFSNODEID/.switch
fi

View File

@ -25,10 +25,10 @@ _|_| | __) __)\/\//--\| \| | renew
echo "I am $IPFSNODEID RESTARTING ~/.zen/astrXbian/A_boostrap_nodes.txt" echo "I am $IPFSNODEID RESTARTING ~/.zen/astrXbian/A_boostrap_nodes.txt"
## SWITCHING OFF ## SWITCHING OFF
echo "0" > ~/.zen/ipfs/.$IPFSNODEID/.switch rm -f ~/.zen/ipfs/.$IPFSNODEID/.switch
~/.zen/astrXbian/zen/ipns_self_publish.sh
sudo systemctl stop ipfs sudo systemctl stop ipfs
sleep 10
## RESTORE BOOTSTRAP ## RESTORE BOOTSTRAP
ipfs bootstrap rm --all ipfs bootstrap rm --all
@ -38,16 +38,13 @@ do
ipfs bootstrap add $bootnode ipfs bootstrap add $bootnode
done done
## STAY CALM 20 + $1 sec ## STOP FOR $1 sec
sleep 20
[[ "$1" =~ ^[0-9]+$ ]] && sleep $1 [[ "$1" =~ ^[0-9]+$ ]] && sleep $1
## SWITCHING ON ## RESTART
echo "1" > ~/.zen/ipfs/.$IPFSNODEID/.switch sudo systemctl restart ipfs
sudo systemctl start ipfs sleep 30
sleep 20
# REFRESH IPNS SELF PUBLISH # REFRESH IPNS SELF PUBLISH
######################################################################## ########################################################################