opt: fix ntfy

This commit is contained in:
2025-12-30 14:53:25 +07:00
parent f3417df036
commit b8b03858a4

View File

@@ -44,20 +44,14 @@ send_ntfy() {
echo -e " ${YELLOW}${NC} Sending push notification..." echo -e " ${YELLOW}${NC} Sending push notification..."
echo -e " ${YELLOW}Debug - Raw MESSAGE:${NC}" echo -e " ${YELLOW}Debug - Message preview:${NC}"
echo "$MESSAGE" | sed 's/^/ RAW: /' echo -e "$MESSAGE" | head -3 | sed 's/^/ /'
echo -e " ${YELLOW}Debug - Interpreted MESSAGE:${NC}"
echo -e "$MESSAGE" | sed 's/^/ INT: /'
echo "" echo ""
# Create temp file with message content # Create temp file with message content
local temp_msg=$(mktemp) local temp_msg=$(mktemp)
echo -e "$MESSAGE" > "$temp_msg" echo -e "$MESSAGE" > "$temp_msg"
echo -e " ${YELLOW}Debug - Temp file content:${NC}"
cat "$temp_msg" | sed 's/^/ FILE: /'
echo ""
# Disable exit on error for curl # Disable exit on error for curl
set +e set +e
response=$(curl -s -w "\n%{http_code}" --http1.1 -k $auth_args \ response=$(curl -s -w "\n%{http_code}" --http1.1 -k $auth_args \
@@ -66,7 +60,7 @@ send_ntfy() {
-H "Priority: 4" \ -H "Priority: 4" \
-H "Click: $click_url" \ -H "Click: $click_url" \
-H "Actions: view, Open Logs, $click_url" \ -H "Actions: view, Open Logs, $click_url" \
-T "$temp_msg" 2>&1) --data-binary "@$temp_msg" 2>&1)
curl_exit_code=$? curl_exit_code=$?
# Clean up temp file # Clean up temp file