24 lines
323 B
Bash
24 lines
323 B
Bash
#!/bin/bash
|
|
|
|
readold() {
|
|
local when=$1 \
|
|
line \
|
|
dataindex \
|
|
empty \
|
|
id \
|
|
LANG=C
|
|
{
|
|
read line
|
|
dataindex=( $line )
|
|
read empty
|
|
read first['time'] $(
|
|
for id in ${dataindex[@]}
|
|
do
|
|
echo "first['"$id"']"
|
|
done
|
|
)
|
|
} < <(
|
|
rrdtool fetch -s "$when" "$rrdfile" AVERAGE | sed '/: nan/d'
|
|
)
|
|
}
|