From d123d11e85877d51e875096161a898207a8d0319 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 11 Aug 2021 04:10:30 +0200 Subject: [PATCH] log correction --- zen/tools/add_externIP_to_ipfstryme.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zen/tools/add_externIP_to_ipfstryme.sh b/zen/tools/add_externIP_to_ipfstryme.sh index 4000d28..a8dc5b5 100755 --- a/zen/tools/add_externIP_to_ipfstryme.sh +++ b/zen/tools/add_externIP_to_ipfstryme.sh @@ -16,7 +16,7 @@ IamInLAN=$(echo $myIP | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\ #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} # 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 done -## Add "liking me" in "swarm peers" station +## Add "liking me" in "swarm peers" station if [[ -f /tmp/liking_me ]]; then for liking_me in $(cat /tmp/liking_me | sort | uniq); do - 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) - if [[ $ipfsaddress ]]; then - 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 "$ipfsaddress" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr - fi + 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) + if [[ $ipfsaddress ]]; then + 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 "$ipfsaddress" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr + fi done fi