-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcatscript.bash~
44 lines (37 loc) · 1.16 KB
/
catscript.bash~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# !/bin/bash
PUBLISHED=/anfs/www/html/meters/elec/published
echo $PUBLISHED
echo "{
\"item-metadata\":[
{
\"rel\":\"urn:X-tsbiot:rels:isContentType\",
\"val\":\"application/vnd.tsbiot.catalogue+json\"
},
{
\"rel\":\"urn:X-tsbiot:rels:hasDescription:en\",
\"val\":\"Sensor Data\"
},
{
\"rel\":\"urn:X-tsbiot:rels:supportsSearch\",
\"val\":\"urn:X-tsbiot:search:simple\"
}
],
\"items\":[
" > text.json
for meter in $PUBLISHED/*; do
# echo $meter
echo "{
\"href\":\"http://www.cl.cam.ac.uk/meters/elec/published/$meter\",
\"i-object-metadata\":[
{
\"rel\":\"urn:X-tsbiot:rels:isContentType\",
\"val\":\"application/json\"
},
{
\"rel\":\"urn:X-tsbiot:hasDescription:en\",
\"val\":\"$meter\"
}
]
},
" >> text.json
done