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

23 lines
350 B
Bash
Executable File

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