diff options
| author | moehm | 2014-08-24 20:16:57 +0200 |
|---|---|---|
| committer | moehm | 2014-08-24 20:16:57 +0200 |
| commit | 5ce187bf4580dc521b1778dc3e3ab76bf05ac77c (patch) | |
| tree | 1135817caae263290f6c8da0961916fd1807c00c /bin/respondtime.sh | |
| parent | 67415c4d7612b2da0bb9e55bebb39db837a6ae33 (diff) | |
| parent | 2e42dd3c875bde5a464c4077e1ea5d424eca1a3f (diff) | |
| download | dotfiles-5ce187bf4580dc521b1778dc3e3ab76bf05ac77c.tar.gz | |
Merge branch 'master' of git.iamfabulous.de:dotfiles
Diffstat (limited to 'bin/respondtime.sh')
| -rwxr-xr-x | bin/respondtime.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/respondtime.sh b/bin/respondtime.sh new file mode 100755 index 0000000..de0731b --- /dev/null +++ b/bin/respondtime.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# use cURL to measure the time until the webpage loads + +CURLINFOTEXT="$(dirname $0)/../resources/curlinfo.txt" + +if [ ! -f "$CURLINFOTEXT" ]; then + echo "$(tput setaf 1)$(tput bold)Failure. $(tput sgr0)No Info Text for cURL given." 1>&2 + exit 1 +fi + +if [ -z "$1" ]; then + echo "$(tput setaf 1)$(tput bold)Failure. $(tput sgr0)Missing URL or Hostname" 1>&2 + exit 1 +fi + +curl -w "@$CURLINFOTEXT" -o /dev/null -s "$1" |
