12 lines
469 B
Bash
12 lines
469 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
sta=$(curl "http://stream.radiospore.oziosi.org:8000/status-json.xsl" | jq -r '.icestats.source[]')
|
||
|
|
||
|
echo $sta | jq -c '.' | while read i; do
|
||
|
listeners=$(echo $i | jq '.listeners')
|
||
|
listenurl=$(basename $(echo $i | jq '.listenurl'| tr -d '"'))
|
||
|
title=$(echo $i | jq '.title' | tr -d '"' | sed 's/ /\\ /g')
|
||
|
|
||
|
curl -XPOST 'http://localhost:8086/write?db=icestat' --data-binary "listeners,listenurl=$listenurl,title=$title value=$listeners"
|
||
|
done
|