* fixes data duplicates in graph rendering
parent
bf4dadd8d6
commit
7ea93eb50c
|
@ -15,6 +15,7 @@ start_date="$(jq -r '.date' < $data | tail -n $lim | head -n1)"
|
|||
end_date="$(jq -r '.date' < $data | tail -n1)"
|
||||
tmp="$(mktemp)"
|
||||
type="$(jq -r '.type' < $data | head -n 1)"
|
||||
a=''
|
||||
|
||||
if [[ "$type" == "ping" ]]; then
|
||||
timedata="$(jq -r '.time' < $data | tail -n $lim)"
|
||||
|
@ -39,10 +40,10 @@ elif [[ "$type" == "req" ]]; then
|
|||
done <<< "$(jq -r '"Name: \(.label)\\\\nDate: \(.date)"' < "$data" | tail -n $lim)" > $tmp
|
||||
elif [[ "$type" == "port" ]]; then
|
||||
timedata="$(jq -r '.status' < $data | tail -n $lim)"
|
||||
for i in $timedata; do
|
||||
if [[ "$i" -gt 0 ]]; then
|
||||
for ii in $timedata; do
|
||||
if [[ "$ii" -gt 0 ]]; then
|
||||
a="${a}0#"
|
||||
elif [[ "$i" == 0 ]]; then
|
||||
elif [[ "$ii" == 0 ]]; then
|
||||
a="${a}1#"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue