|
|
@ -22,14 +22,6 @@ ME="${0##*/}" |
|
|
|
|
|
|
|
## TODO : Beware of liking_me FLOOD & Invite $liking_me people to my #Swarm0 |
|
|
|
|
|
|
|
######################################################################## |
|
|
|
## CONNECT GLOBAL "ipfs.io" ## DANGEROUS DATA LEAK only for short time... |
|
|
|
######################################################################## |
|
|
|
# ADD ipfs.io public bootstrap into your swarm peers |
|
|
|
# RUN: cat ~/.zen/astroport/ipfs.swarm.ipfs.io | ipfs swarm connect |
|
|
|
# SOON ipfs swarm peers will GROW!!! YOU ARE VSIBLE !!! |
|
|
|
# RUN: sudo systemctl restart ipfs # GOES BACK TO SWARM0 |
|
|
|
######################################################################## |
|
|
|
|
|
|
|
######################################################################## |
|
|
|
# ENVIRONEMENT DETECTION + IPFS ~/.zen/ipfs/.$IPFSNODEID/G1SSB/_info |
|
|
@ -43,6 +35,7 @@ isIPFSRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|gr |
|
|
|
# Force Strict #swarm0 !!? |
|
|
|
# ipfs bootstrap rm --all |
|
|
|
echo "" > ~/.zen/A_allow_ip.txt |
|
|
|
|
|
|
|
echo "" > ~/.zen/A_liking_me_NO_ipfstryme.txt # contains "friends" with no "ipfstryme" incoming message |
|
|
|
liking_me_count=0 |
|
|
|
friend_of_mine_count=0 |
|
|
@ -65,7 +58,7 @@ do |
|
|
|
echo $ip >> ~/.zen/A_allow_ip.txt |
|
|
|
# Get its ipfsnodeid |
|
|
|
ipfsnodeid=$(echo "$peer" | awk -F '/' '{print $7}') |
|
|
|
|
|
|
|
|
|
|
|
# 3. ADD liking_me friend_of_mine to my swarm & bootstrap |
|
|
|
ipfs swarm connect $peer; |
|
|
|
ipfs bootstrap add $peer; |
|
|
@ -73,15 +66,19 @@ do |
|
|
|
ipfsadd=$((ipfsadd+1)) |
|
|
|
done; |
|
|
|
|
|
|
|
#g1id=$(~/.zen/astroport/zen/tools/ipfs_to_g1.py "$ipfsnodeid") |
|
|
|
#echo "G1 ID : $g1id" |
|
|
|
|
|
|
|
if [[ $friend_of_mine != null ]]; then |
|
|
|
if [[ $ipfsadd == 0 ]]; then |
|
|
|
# Friend of mine with no ipfstryme message (did not install astroport) |
|
|
|
echo "No 'ipfstryme' message... from $liking_me" |
|
|
|
echo "$liking_me" >> ~/.zen/A_liking_me_NO_ipfstryme.txt |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
# REMOVING DUPLICATES OLD ipfstryme MESSAGES |
|
|
|
nbmessage=0 |
|
|
|
for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq -r '.id') |
|
|
|
for messageid in $(./jaklis.py read -n50 -j | jq -r --arg friendKEY "$liking_me" '.[] | select(.pubkey == $friendKEY)' | jq 'select(.title == "ipfstryme")' | jq -r '.id') |
|
|
|
do |
|
|
|
nbmessage=$((nbmessage+1)) |
|
|
|
[ $nbmessage -gt 1 ] && echo "Delete OLD 'ipfstryme' messages from $liking_me" && ./jaklis.py delete -i $messageid |
|
|
@ -106,9 +103,9 @@ My actual #SWARM0" |
|
|
|
ipfs swarm peers |
|
|
|
echo "__________________________________________" |
|
|
|
echo |
|
|
|
## Send message to |
|
|
|
## Could send message to friends with 'ipfstryme' message |
|
|
|
for line in $(cat ~/.zen/A_liking_me_NO_ipfstryme.txt | uniq); do |
|
|
|
echo "Liking ME, but no ipfstryme received..." |
|
|
|
echo "Liking each other, but no ipfstryme received..." |
|
|
|
echo "cd ~/.zen/astroport/zen/jaklis" |
|
|
|
echo "./jaklis.py send -d $line -t 'Astroport' -m 'Rejoins mon #Swarm0 https://copylaradio.com'" |
|
|
|
done |
|
|
|