From a1ad3390d895c4eeab26eb8170d85b8ebc99cdcb Mon Sep 17 00:00:00 2001 From: qo-op Date: Tue, 8 Dec 2020 14:01:35 +0100 Subject: [PATCH] Sending IPFSTRYME message to $liking_me if ISO already config BOOT --- ISOconfig.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ISOconfig.sh b/ISOconfig.sh index c9b2150..8ff955d 100755 --- a/ISOconfig.sh +++ b/ISOconfig.sh @@ -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...'