diff options
| author | Michael Peter Christen <mc@yacy.net> | 2012-01-31 23:21:49 +0100 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2012-01-31 23:21:49 +0100 |
| commit | 5e18f54a8c7fd7916472e95fe92edd5ff7f5f6bf (patch) | |
| tree | 9bf9ffd23777aeb79fa7fe0c03362ebc3fb32aee /bin | |
| parent | 3cd6dcd352f8d3035e9cfb98d37b27987ac37e28 (diff) | |
added shell script to get a servlet. this is the same as apicall.sh but it prints the result to stdout
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/apicat.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/apicat.sh b/bin/apicat.sh new file mode 100755 index 000000000..f361778ac --- /dev/null +++ b/bin/apicat.sh @@ -0,0 +1,12 @@ +#!/bin/bash +cd "`dirname $0`" +port=$(grep ^port= ../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 --header "Authorization: realm=$pw" "http://127.0.0.1:$port/$1" +elif which wget &>/dev/null; then + wget -q -t 1 --timeout=5 --header "Authorization: realm=$pw" "http://127.0.0.1:$port/$1" +else + exit 1 +fi |
