- added more selection criteria for network seed list

- enhanced up script
This commit is contained in:
Michael Peter Christen 2013-03-10 02:26:24 +01:00
parent 252bb51f98
commit 3d9ce9cd04
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
cd "`dirname $0`" cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2) ./apicall.sh "/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
./up1.sh localhost:$port
#port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
#./up1.sh localhost:$port

View File

@ -1,10 +0,0 @@
#!/bin/bash
cd "`dirname $0`"
if which curl &>/dev/null; then
curl -s "http://$1/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
elif which wget &>/dev/null; then
wget -q -O - "http://$1/Network.xml?page=1&ip=" | awk '/<address>/{ gsub("<address>","" );gsub("<\/address>","" ); print $0 }' | awk '{print $1}';
else
exit 1
fi

View File

@ -284,6 +284,10 @@ public class Network {
boolean dark = true; boolean dark = true;
Seed seed; Seed seed;
final boolean complete = (post != null && post.containsKey("ip")); final boolean complete = (post != null && post.containsKey("ip"));
final boolean onlyIncomingDHT = (post != null && post.containsKey("onlydhtin"));
final boolean onlyNode = (post != null && post.containsKey("onlynode"));
final long onlyAgeOverDays = post == null ? 0 : post.getLong("onlyageoverdays", 0);
final long onlySizeLessDocs = post == null ? Long.MAX_VALUE : post.getLong("onlysizelessdocs", Long.MAX_VALUE);
Iterator<Seed> e = null; Iterator<Seed> e = null;
final boolean order = (post != null && post.get("order", "down").equals("up")); final boolean order = (post != null && post.get("order", "down").equals("up"));
final String sort = (post == null ? null : post.get("sort", null)); final String sort = (post == null ? null : post.get("sort", null));
@ -315,6 +319,10 @@ public class Network {
seed = e.next(); seed = e.next();
assert seed != null; assert seed != null;
if (seed != null) { if (seed != null) {
if (onlyIncomingDHT && !seed.getFlagAcceptRemoteIndex()) continue;
if (onlyNode && !seed.getFlagRootNode()) continue;
if (seed.getAge() < onlyAgeOverDays) continue;
if (seed.getLinkCount() > onlySizeLessDocs) continue;
if((post != null && post.containsKey("search")) && peerSearchPattern != null /*(wrongregex == null)*/) { if((post != null && post.containsKey("search")) && peerSearchPattern != null /*(wrongregex == null)*/) {
boolean abort = true; boolean abort = true;
Matcher m = peerSearchPattern.matcher (seed.getName()); Matcher m = peerSearchPattern.matcher (seed.getName());