/tmp/ssb-friends_ALERT.txt
This commit is contained in:
parent
480a8c72ff
commit
8931334d51
|
@ -53,13 +53,16 @@ do
|
||||||
### Is "ipfs_swarm/.$id/G1SSB/_ssb.whoami" my SSB friend??
|
### Is "ipfs_swarm/.$id/G1SSB/_ssb.whoami" my SSB friend??
|
||||||
ssbID=$(cat /home/$YOU/.zen/ipfs_swarm/.$id/G1SSB/_ssb.whoami)
|
ssbID=$(cat /home/$YOU/.zen/ipfs_swarm/.$id/G1SSB/_ssb.whoami)
|
||||||
isMyFriend=$(grep -Rwl "$ssbID" /tmp/ssb-friends.txt)
|
isMyFriend=$(grep -Rwl "$ssbID" /tmp/ssb-friends.txt)
|
||||||
if [[ ! $isMyFriend ]]; then
|
if [[ -f /tmp/ssb-friends.txt && ! $isMyFriend ]]; then
|
||||||
echo "WARNING! $count IS NOT my SSB Friend !!! Check $ssbID"
|
echo "WARNING! $count IS NOT my SSB Friend !!! Check $ssbID"
|
||||||
rm -Rf /home/$YOU/.zen/ipfs_swarm/.$id
|
rm -Rf /home/$YOU/.zen/ipfs_swarm/.$id
|
||||||
ipfs swarm disconnect $peer
|
ipfs swarm disconnect $peer
|
||||||
ipfs bootstrap rm $peer
|
ipfs bootstrap rm $peer
|
||||||
## TODO: Send sbotc message
|
## TODO: Send sbotc message
|
||||||
sbotc private.publish '{"type":"post","text":"ALERT '"$ssbID"' is trying to connect to IPFS swarm as '"$peer"'"}'
|
if [[ -f /tmp/ssb-friends_ALERT.txt && ! $(grep -Rwl "$ssbID" /tmp/ssb-friends_ALERT.txt) ]]; then
|
||||||
|
sbotc publish '{"type":"post","text":"ALERT '"$ssbID"' is trying to connect to IPFS swarm (http://127.0.0.1/ipfs/'"$id"')"}'
|
||||||
|
echo "$ssbID" >> /tmp/ssb-friends_ALERT.txt
|
||||||
|
fi
|
||||||
## TODO: Use fail2ban if same node continue entering our swarm...
|
## TODO: Use fail2ban if same node continue entering our swarm...
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue