mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-11 23:50:08 +01:00
feat: compact bandwodth
This commit is contained in:
parent
de0e8225a6
commit
4486f2d02c
1 changed files with 13 additions and 13 deletions
|
|
@ -50,28 +50,28 @@ main() {
|
||||||
total_upload_bps=$(expr "$final_upload" - "$initial_upload")
|
total_upload_bps=$(expr "$final_upload" - "$initial_upload")
|
||||||
|
|
||||||
if [ "$total_download_bps" -gt 1073741824 ]; then
|
if [ "$total_download_bps" -gt 1073741824 ]; then
|
||||||
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.2f \n", $1/($2 * $2 * $2)}')
|
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.1f \n", $1/($2 * $2 * $2)}')
|
||||||
output_download_unit="gB/s"
|
output_download_unit="G"
|
||||||
elif [ "$total_download_bps" -gt 1048576 ]; then
|
elif [ "$total_download_bps" -gt 1048576 ]; then
|
||||||
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.2f \n", $1/($2 * $2)}')
|
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.1f \n", $1/($2 * $2)}')
|
||||||
output_download_unit="mB/s"
|
output_download_unit="M"
|
||||||
else
|
else
|
||||||
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.2f \n", $1/$2}')
|
output_download=$(echo "$total_download_bps 1024" | awk '{printf "%.1f \n", $1/$2}')
|
||||||
output_download_unit="kB/s"
|
output_download_unit="K"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$total_upload_bps" -gt 1073741824 ]; then
|
if [ "$total_upload_bps" -gt 1073741824 ]; then
|
||||||
output_upload=$(echo "$total_download_bps 1024" | awk '{printf "%.2f \n", $1/($2 * $2 * $2)}')
|
output_upload=$(echo "$total_download_bps 1024" | awk '{printf "%.1f \n", $1/($2 * $2 * $2)}')
|
||||||
output_upload_unit="gB/s"
|
output_upload_unit="G"
|
||||||
elif [ "$total_upload_bps" -gt 1048576 ]; then
|
elif [ "$total_upload_bps" -gt 1048576 ]; then
|
||||||
output_upload=$(echo "$total_upload_bps 1024" | awk '{printf "%.2f \n", $1/($2 * $2)}')
|
output_upload=$(echo "$total_upload_bps 1024" | awk '{printf "%.1f \n", $1/($2 * $2)}')
|
||||||
output_upload_unit="mB/s"
|
output_upload_unit="M"
|
||||||
else
|
else
|
||||||
output_upload=$(echo "$total_upload_bps 1024" | awk '{printf "%.2f \n", $1/$2}')
|
output_upload=$(echo "$total_upload_bps 1024" | awk '{printf "%.1f \n", $1/$2}')
|
||||||
output_upload_unit="kB/s"
|
output_upload_unit="K"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "↓ $output_download$output_download_unit • ↑ $output_upload$output_upload_unit"
|
echo "↓ $output_download$output_download_unit•↑ $output_upload$output_upload_unit"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
main
|
main
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue