forked from axiom-team/astrXbian
Prefer 4001 port addresses
This commit is contained in:
parent
36f0fbaea2
commit
fd47c1bb82
|
@ -58,7 +58,7 @@ ipfs swarm peers >> /tmp/ipfs_swarm_peers
|
||||||
rm ~/.zen/A_peering_peers.txt
|
rm ~/.zen/A_peering_peers.txt
|
||||||
|
|
||||||
# for ipfsnodeid in $( (cat /tmp/ipfs_swarm_peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq); ## TODO ACTIVATE IN DEFCON 4
|
# for ipfsnodeid in $( (cat /tmp/ipfs_swarm_peers | grep -o '[^/]*$' && cat /tmp/A_swarm | grep -o '[^/]*$' ) | sort | uniq); ## TODO ACTIVATE IN DEFCON 4
|
||||||
for ipfsnodeid in $(cat ~/.zen/ipfs_swarm/.*/tryme.addr | grep -o '[^/]*$' | sort | uniq);
|
for ipfsnodeid in $(cat ~/.zen/ipfs_swarm/.*/tryme.addr | grep -o '[^/]*$' | sort | uniq);
|
||||||
do
|
do
|
||||||
## $ipfsnodeid already Treated ?
|
## $ipfsnodeid already Treated ?
|
||||||
[[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue
|
[[ "$ipfsnodeid" == "$IPFSNODEID" ]] && continue
|
||||||
|
@ -70,7 +70,7 @@ do
|
||||||
|
|
||||||
|
|
||||||
# control ip isLAN?
|
# control ip isLAN?
|
||||||
peerline=$(cat ~/.zen/A_swarm_map.txt | grep "$ipfsnodeid" | tail -n 1)
|
peerline=$(cat ~/.zen/A_swarm_map.txt | grep "$ipfsnodeid" | grep '/4001/' | tail -n 1) ## Prefer 4001 port addresses
|
||||||
[[ ! $peerline ]] && peerline=$(cat /tmp/ipfs_swarm_peers | grep "$ipfsnodeid" | tail -n 1)
|
[[ ! $peerline ]] && peerline=$(cat /tmp/ipfs_swarm_peers | grep "$ipfsnodeid" | tail -n 1)
|
||||||
ip=$(cat /tmp/ipfs_swarm_peers | grep "$ipfsnodeid" | awk -F '/' '{print $3}' | tail -n 1) && [[ ! $ip ]] && continue
|
ip=$(cat /tmp/ipfs_swarm_peers | grep "$ipfsnodeid" | awk -F '/' '{print $3}' | tail -n 1) && [[ ! $ip ]] && continue
|
||||||
isLAN=$(echo $ip | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
isLAN=$(echo $ip | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
|
||||||
|
|
Loading…
Reference in New Issue