warn-if-broken-url/warn-if-broken-url.sh

19 lines
304 B
Bash
Raw Normal View History

2021-01-08 19:13:29 +00:00
#!/usr/bin/env bash
set -eu
URL="https://status.caracals.org"
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
pushd ${SCRIPT_PATH} > /dev/null
if ret=$(curl -s -f "${URL}"); then
echo "Marche"
else
echo "Marche pôs"
cat msg.txt | msmtp alban.bronisz@gmail.com
fi
popd