24 lines
836 B
Bash
24 lines
836 B
Bash
#!/bin/bash
|
|
|
|
# --- CONFIGURATION ---
|
|
# Replace with the actual path to your update script
|
|
UPDATE_SCRIPT="/mnt/tank/scripts/lxc-update.sh"
|
|
# Replace with your specific Uptime Kuma Push URL
|
|
KUMA_URL="https://uptime.liphlink.xyz/api/push/2H3mltg79B?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
|