This commit is contained in:
qo-op 2020-12-25 20:11:03 +01:00
parent aad0f3e235
commit 8db669bc46
1 changed files with 10 additions and 21 deletions

View File

@ -15,34 +15,23 @@
# ~/.zen/ipfs.sync
########################################################################
# CHECK INTERNET CONNECTIVITY & git pull !!
rm -f /tmp/A_booting_log.txt
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || (echo "NO INTERNET CONNEXION" && exit 1)
[[ -d ~/.zen/astrXbian ]] && cd ~/.zen/astrXbian && git pull || exit 1
# CHECK IF CONFIG ALREADY DONE !! Remove ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync
if [[ -f ~/.zen/ipfs.sync ]]; then
echo "CONFIG ALREADY DONE"
echo "CONFIG ALREADY DONE.... logging init in /tmp/A_booting_log.txt"
source ~/.zen/ipfs.sync
# Wait for ipfs to connect to its swarm, then send ipfstryme to $friend_of_mine
sleep 30
echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr # ERASE
for tryme in $(ipfs id | jq -r .Addresses[]);
do
isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ ! $isLAN && $tryme != "" ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr && echo "$tryme"
done
# Wait for ipfs to connect to its swarm
sleep 20
~/.zen/astrXbian/zen/gchange_INIT.sh >> /tmp/A_booting_log.txt
sleep 10
~/.zen/astrXbian/zen/gchange_IPFS_swarm.sh >> /tmp/A_booting_log.txt
sleep 10
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh >> /tmp/A_booting_log.txt
# NEW BOOT! SEND ipfstryme message to my friends...
cd ~/.zen/astrXbian/zen/jaklis
# GET LIST of issuer(s) who likes me
for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer');
do
# CHECk if I am liking him either
friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours');
echo "Sending IPFSTRYME message to $liking_me"
[[ $friend_of_mine != null ]] && ./jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
done
cd -
exit 0
fi
@ -132,7 +121,7 @@ echo "CREATE + profile"
########################################################################
########################################################################
echo "BECOME FRIEND with oasis (1st bootstrap)"
echo "BECOME FRIEND with A_boostrap_nodes.txt (1st bootstrap)"
########################################################################
for g1node in $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#") # remove comments
do