Files
scripts_serv/ping_paperless_backup.sh
2026-10-02 22:35:11 +02:00

24 lines
842 B
Bash

#!/bin/bash
# --- CONFIGURATION ---
# Replace with the actual path to your update script
UPDATE_SCRIPT="/mnt/tank/scripts/paperless_backup.sh"
# Replace with your specific Uptime Kuma Push URL
KUMA_URL="https://uptime.liphlink.xyz/api/push/LW7OZFTXSa?status=up&msg=OK&ping="
# --- EXECUTION ---
# Run the LXC update script
# The script will process LXCs, run paru/pacman updates, and handle maintenance [1]
bash "$UPDATE_SCRIPT"
EXIT_CODE=$?
# --- PING LOGIC ---
if [ $EXIT_CODE -eq 0 ]; then
# If the script finishes the entire loop and maintenance tasks successfully [1]
/usr/bin/curl -fsS --retry 3 "${KUMA_URL}?status=up&msg=LXC_Updates_Successful"
else
# If any part of the script fails (due to set -e), send a 'down' status [1]
/usr/bin/curl -fsS --retry 3 "${KUMA_URL}?status=down&msg=LXC_Update_Failed_Exit_$EXIT_CODE"
fi