Notify at Discord channel when docker containers are down.
cp config.sh.example config.sh
url='https://discord.com/api/webhooks/99999999999999999999/______very_crazy_hash______'
username='MyBotName'
listOfContainers="mycontainer1 mycontainer2"
./start.sh
To work with a schedule to execute this script you can set following below.
- Set the env
DISCORD_CONTAINER_NOTIFIER_DIR
globally to current dir
sudo sh -c "echo \"DISCORD_CONTAINER_NOTIFIER_DIR=$(pwd)\" >> /etc/environment"
- Add scheduled job
crontab -e
*/5 * * * * sh -c "$DISCORD_CONTAINER_NOTIFIER_DIR/start.sh"
grep CRON /var/log/syslog
# or
tail -f /var/log/syslog | grep CRON