summaryrefslogtreecommitdiff
path: root/bin/respondtime.sh
blob: de0731b7ec01768f0e737ebdfa2b2d44fd70b3d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"