Sending IPFSTRYME message to $liking_me if ISO already config BOOT

This commit is contained in:
qo-op 2020-12-08 14:01:35 +01:00
parent 8efc0075ba
commit a1ad3390d8
1 changed files with 18 additions and 2 deletions

View File

@ -16,7 +16,22 @@
########################################################################
# CHECK IF CONFIG ALREADY DONE !! Remove ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync
[[ -f ~/.zen/ipfs.sync ]] && echo "CONFIG ALREADY DONE" && source ~/.zen/ipfs.sync && exit 0
if [[ -f ~/.zen/ipfs.sync ]]; then
echo "CONFIG ALREADY DONE"
source ~/.zen/ipfs.sync
# NEW BOOT! SEND ipfstryme message to my friends...
cd ~/.zen/astroport/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
# CHECK INTERNET CONNECTIVITY !!
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || (echo "NO INTERNET CONNEXION" && exit 1)
@ -159,7 +174,8 @@ echo 'INSTALL Astroport cron_MINUTE'
~/.zen/astroport/zen/tools/cron_VRFY.sh
# Run only once: comment /etc/rc.local (su - xbian -c "~/.zen/astroport/ISOconfig.sh")
sudo sed -i s/su/\#su/g /etc/rc.local
# sudo sed -i s/su/\#su/g /etc/rc.local
# BETTER NOT: Send new 'ipfstryme' message on each boot is done instead
########################################################################
echo 'REBOOT NOW...'