swarm of friends testing

This commit is contained in:
qo-op 2021-05-30 22:47:55 +02:00
parent e200d78498
commit bff9bee2dc
1 changed files with 19 additions and 0 deletions

19
zen/swarm_testing.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
if [[ $(date +%s -r /tmp/liking_me) -lt $(date +%s --date="1 day ago") ]]; then
echo "...... refreshing /tmp/liking_me"
~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' > /tmp/liking_me
fi
for liking_me in $(cat /tmp/liking_me);
do
echo "$liking_me is liking me"
station=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me)
# ipfs --timeout=6s ls /ipns/$station
TEST=$(~/.zen/astrXbian/zen/jaklis/jaklis.py -k ~/.zen/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me | jq -r '.yours.level')
if [ ! $TEST == 'null' ]; then
echo "$station is my friend"
ipfs --timeout=6s cat /ipns/$station/.$station/_xbian.zuid
[ ! $? == 0 ] && echo "UNAVAILABLE FRIEND $liking_me"
sleep 1
fi
done