ipfs_SWARM_refresh.sh

This commit is contained in:
qo-op 2020-12-07 14:45:13 +01:00
parent 2ccbfaa344
commit c432c3d3f9
1 changed files with 7 additions and 1 deletions

View File

@ -54,12 +54,13 @@ do
ipfs swarm disconnect $peer
ipfs bootstrap rm $peer
echo "# FAIL2BAN # $USER must activate no password sudo (Rpi & Xbian OK)"
[[ $USER == "pi" || $USER == "xbian" ]] && echo "BAN $ip" \
&& sudo fail2ban-client add recidive \
&& sudo fail2ban-client set recidive banip $ip
else
# REFRESH ~/.zen/ipfs_swarm/
echo "REFRESH /ipns/$ipfsnodeid INTO ~/.zen/ipfs_swarm/"
$MY_PATH/tools/timeout.sh -t 30 ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$ipfsnodeid
fi
@ -74,4 +75,9 @@ NODEIPNS=$(ipfs name publish --quieter /ipfs/$IWALLETS)
# Put my own data in /home/$YOU/.zen/ipfs_swarm/
ipfs get --output=/home/$YOU/.zen/ipfs_swarm/ /ipns/$IPFSNODEID
# NB: could start sync IPNS from "swarm peers" and check ~/.zen/ipfs_swarm/.$ipfsnodeid/G1SSB/_g1.pubkey
# if it is a gchange friend of mine... Then decide to bannish or keep.
# But IPNS sync with bad node could lead to a filesystem concistency corruption...
# Should be sync in a temp separate folder... So keeping IP control for now.
exit 0