diff options
author | Jan Huwald <jh@sotun.de> | 2012-04-04 16:49:36 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-04-04 16:49:36 (GMT) |
commit | 65059b17dbd62fccd600599e4f288737bb477a48 (patch) | |
tree | ecab5e6d5ac9a877bddf3dd4ecc730ded51ae4e8 | |
parent | 0985bba70a9c5ac55059fe5b74da636a263939d8 (diff) |
www: add services.json
Returns a copy of the services p2ptbl in JSON format.
-rwxr-xr-x | files/common/www/service/cgi-bin/services.json | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/files/common/www/service/cgi-bin/services.json b/files/common/www/service/cgi-bin/services.json new file mode 100755 index 0000000..3350efc --- /dev/null +++ b/files/common/www/service/cgi-bin/services.json @@ -0,0 +1,23 @@ +#!/bin/sh -e + +. /www/service/cgi-bin/common.sh + +echo -e 'Status: 200 OK\r +Content-Type: application/json\r +\r +[' + +p2ptbl show /tmp/p2ptbl/service \ + | sed ' +s/^/{"url": "/ +s/\t/", "expire": "/ +s/\t/", "source": "/ +s/\t/", "class": "/ +s/\t/", "desc": "/ +s/\t/", "custom1": "/ +s/\t/", "custom2": "/ +s/\t/", "custom3": "/ +s/$/"},/ +$s/,$//' + +echo ']' |