* fixes data duplicates in graph rendering

master
Dominika Liberda 2021-06-10 22:20:03 +00:00
parent bf4dadd8d6
commit 7ea93eb50c
1 changed files with 4 additions and 3 deletions

View File

@ -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