using the adminAccountUserName from yacy.conf within apicall.sh

pull/1/head
Michael Peter Christen 11 years ago
parent add0e42804
commit 644573cfc4

@ -1,12 +1,13 @@
#!/bin/bash
cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
admin=$(grep ^adminAccountUserName= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
pw=$(grep ^adminAccountBase64MD5= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
if which curl &>/dev/null; then
curl -s -u admin:$pw "http://127.0.0.1:$port/$1"
curl -s -u $admin:$pw "http://127.0.0.1:$port/$1"
elif which wget &>/dev/null; then
wget -q -t 1 --timeout=120 --http-user admin --http-password pw "http://127.0.0.1:$port/$1" -O -
wget -q -t 1 --timeout=120 --http-user $admin --http-password $pw "http://127.0.0.1:$port/$1" -O -
else
exit 1
fi

@ -638,10 +638,6 @@ public class Domains {
if ((host == null) || host.isEmpty()) return null;
host = host.toLowerCase().trim();
// try to simply parse the address
// InetAddress ip = InetAddress.getByName(host);
// if (ip != null) return ip;
// trying to resolve host by doing a name cache lookup
InetAddress ip = NAME_CACHE_HIT.get(host);
if (ip != null) {
@ -685,14 +681,6 @@ public class Domains {
NAME_CACHE_HIT.insertIfAbsent(host, i);
cacheHit_Insert++;
return host;
/*
// call i.getHostName() using concurrency to interrupt execution in case of a time-out
try {
//TimeoutRequest.getHostName(i, 1000);
} catch (final ExecutionException e) {
return i.getHostAddress();
}
*/
}
/**
@ -716,15 +704,6 @@ public class Domains {
public static InetAddress dnsResolve(final String host0) {
if (host0 == null || host0.isEmpty()) return null;
final String host = host0.toLowerCase().trim();
// try to simply parse the address
InetAddress ip;
// try {
// ip = InetAddress.getByName(host);
// return ip;
// } catch (UnknownHostException e1) {
// // we expected that InetAddress.getByName may fail if this is not a raw address.
// // We silently ignore this and go on.
// }
/*
if (MemoryControl.shortStatus()) {
@ -734,7 +713,7 @@ public class Domains {
*/
// try to resolve host by doing a name cache lookup
ip = NAME_CACHE_HIT.get(host);
InetAddress ip = NAME_CACHE_HIT.get(host);
if (ip != null) {
//System.out.println("DNSLOOKUP-CACHE-HIT(CONC) " + host);
cacheHit_Hit++;

Loading…
Cancel
Save