#!/bin/sh

set -eu

url="${1}"
output="$(mktemp --tmpdir passenger.XXXXXXXXXX)"
retry --times=10 --delay=1,2,4,8,16 -- \
  wget --output-document="${output}" "${url}"

if [ "$(cat $output)" != "hello world" ]; then
  echo "output is wrong"
  echo "got:      | $output |"
  echo "expected: | hello world |"
  exit 1
fi
