From 65059b17dbd62fccd600599e4f288737bb477a48 Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Wed, 4 Apr 2012 16:49:36 +0000 Subject: www: add services.json Returns a copy of the services p2ptbl in JSON format. 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 ']' -- cgit v0.10.1