Files
agence66-borgmatic/hooks/uptime-kuma-success.sh
BeauTroll 21355eceff
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled
Add Uptime Kuma monitoring integration with dedicated hooks
Implement Uptime Kuma Push Monitor support with separate hook files
following separation of concerns principle.

Changes:
- Add UPTIME_KUMA_PUSH_URL to .env.example
- Create dedicated uptime-kuma-success.sh hook
- Create dedicated uptime-kuma-error.sh hook
- Update config.yaml to call both ntfy and Uptime Kuma hooks
- Each notification service has its own file for modularity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:26:48 +01:00

29 lines
666 B
Bash
Executable File

#!/bin/bash
#
# Hook Borgmatic - Ping Uptime Kuma en cas de succès
# Borgmatic 2.0 utilise des variables d'environnement
#
# Charger les variables d'environnement
if [ -f /etc/borgmatic/.env ]; then
source /etc/borgmatic/.env
fi
# Vérifier que l'URL Uptime Kuma est configurée
if [ -z "$UPTIME_KUMA_PUSH_URL" ]; then
echo "UPTIME_KUMA_PUSH_URL non configuré, ping ignoré"
exit 0
fi
# Ping Uptime Kuma avec status=up
curl -s "${UPTIME_KUMA_PUSH_URL}?status=up&msg=Backup%20successful&ping=" > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Ping Uptime Kuma envoyé (success)"
else
echo "Erreur lors du ping Uptime Kuma"
exit 1
fi
exit 0