astrXbian/zen/ipfs_BOOTSTRAP_me.sh

31 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.12.22
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# Auto maticaly accept incoming frendship sending back 3 stars like
# AstrXbian NODE running it starts acting like a "SSB" PUB
# Best using 24/24 public IP node + 1 TB
# GET XZUID
[[ ! -f ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid ]] && echo "ERROR no _xbian.zuid" && exit 1
XZUID=$(cat ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid) # Should be hostname... but like that can be changed...
isG1PUBoot=$(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep "$G1PUB") # search my G1PUB ?
if [[ $isG1PUBoot == "$G1PUB" ]]; then
for liking_me in $(/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like | jq -r '.likes[].issuer')
do
echo "SENDING 3 STARS to $liking_me"
/home/$YOU/.zen/astrXbian/zen/jaklis/jaklis.py like -p $liking_me -s 3
echo "Our SWARM will join during ipfs_SWARM_refresh.sh RUN"
done
fi
~/.zen/astrXbian/zen/ipfs_SWARM_refresh.sh
echo "Share collected indexes as mine"
cp /var/www/astrxbian/FASTRXBIAN ~/.zen/ipfs/xbian/F${XZUID}