diff --git a/README.md b/README.md index d940909..73cbf16 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ will create the symbolic link for each script in the \ directory. ## Network - [check-cert](scripts/check-cert) retrieves information about web site's TLS certificate. +- [curl-speed](scripts/curl-speed) tests response time for specified URL. - [ipcalc](scripts/ipcalc) is DIY tcl version of [jodies.de/ipcalc](https://jodies.de/ipcalc), it takes an IP address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. ## WWW diff --git a/scripts/curl-speed b/scripts/curl-speed new file mode 100755 index 0000000..a225a28 --- /dev/null +++ b/scripts/curl-speed @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +#Создан: вс 03 окт 2021 13:41:35 +#Изменён: вс 03 окт 2021 13:52:09 + +# Get response time for URL. +# (c) idea: https://sysadmin.pm/curl-site-speed/ + +IFS='' read -r -d '' OUTPUT_FORMAT <<-EOF + # Test response time for %{url_effective} + + Lookup Time: %{time_namelookup} + Connect Time: %{time_connect} + AppCon Time: %{time_appconnect} + Redirect Time: %{time_redirect} + Pre-transfer Time: %{time_pretransfer} + Start-transfer Time: %{time_starttransfer} + + Total Time: %{time_total} +EOF + +curl -s -w "$OUTPUT_FORMAT" -o /dev/null "${1?USAGE: $(basename "$0" URL)}" +