new convenience script

This commit is contained in:
goldsquid
2025-08-31 13:48:38 +07:00
parent 8ec2673626
commit 411c1d12a5

3
utils/download-size.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
curl -sI $1 | awk '/[Cc]ontent-[Ll]ength/ {gsub(/\r/,""); size=$2; if (size >= 1073741824) printf "%.2f GB\n", size/1073741824; else if (size >= 1048576) printf "%.2f MB\n", size/1048576; else if (size >= 1024) printf "%.2f KB\n", size/1024; else printf "%d B\n", size}'