/tmp/ssb-friends_ALERT.txt

This commit is contained in:
qo-op 2020-05-26 22:05:11 +02:00
parent 480a8c72ff
commit 8931334d51
1 changed files with 5 additions and 2 deletions

View File

@ -53,13 +53,16 @@ do
### Is "ipfs_swarm/.$id/G1SSB/_ssb.whoami" my SSB friend??
ssbID=$(cat /home/$YOU/.zen/ipfs_swarm/.$id/G1SSB/_ssb.whoami)
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"
rm -Rf /home/$YOU/.zen/ipfs_swarm/.$id
ipfs swarm disconnect $peer
ipfs bootstrap rm $peer
## 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...
continue
fi