log correction

This commit is contained in:
fred 2021-08-11 04:10:30 +02:00
parent 5cd58ce56f
commit d123d11e85
1 changed files with 9 additions and 9 deletions

View File

@ -16,7 +16,7 @@ IamInLAN=$(echo $myIP | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\
#EXTERNIP=$(curl -s http://whatismyip.akamai.com/) #EXTERNIP=$(curl -s http://whatismyip.akamai.com/)
######################################################################## ########################################################################
echo "CREATING MY /home/$USER/.zen/ipfs/.${IPFSNODEID}/tryme.addr" echo "CREATING MY /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr"
######################################################################## ########################################################################
mkdir -p ~/.zen/ipfs/.${IPFSNODEID} mkdir -p ~/.zen/ipfs/.${IPFSNODEID}
# echo "/ip4/$EXTERNIP/udp/4001/astro/p2p/${IPFSNODEID}" >> /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr # echo "/ip4/$EXTERNIP/udp/4001/astro/p2p/${IPFSNODEID}" >> /home/$YOU/.zen/ipfs/.${IPFSNODEID}/tryme.addr
@ -37,17 +37,17 @@ do
[[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr [[ ! $isLAN ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
done done
## Add "liking me" in "swarm peers" station ## Add "liking me" in "swarm peers" station
if [[ -f /tmp/liking_me ]]; then if [[ -f /tmp/liking_me ]]; then
for liking_me in $(cat /tmp/liking_me | sort | uniq); for liking_me in $(cat /tmp/liking_me | sort | uniq);
do do
ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me) ipfsnodeid=$(~/.zen/astrXbian/zen/tools/g1_to_ipfs.py $liking_me)
[[ -f /tmp/ipfs_swarm_peers ]] && ipfsaddress=$(cat /tmp/ipfs_swarm_peers | grep $ipfsnodeid | tail -n 1) [[ -f /tmp/ipfs_swarm_peers ]] && ipfsaddress=$(cat /tmp/ipfs_swarm_peers | grep $ipfsnodeid | tail -n 1)
if [[ $ipfsaddress ]]; then if [[ $ipfsaddress ]]; then
nodeip=$(echo $ipfsaddress | cut -d '/' -f 3) nodeip=$(echo $ipfsaddress | cut -d '/' -f 3)
IsLAN=$(echo $nodeip | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" ) IsLAN=$(echo $nodeip | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/" )
[[ ! $IsLAN ]] && echo "$ipfsaddress" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr [[ ! $IsLAN ]] && echo "$ipfsaddress" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
fi fi
done done
fi fi