#!/bin/bash # Test ntfy notification endpoints # Tests both local and external ntfy servers set -e echo "๐Ÿงช ntfy Notification Test Script" echo "================================" echo # Test local ntfy server (IP) echo "๐Ÿ“ก Testing Local ntfy Server (192.168.0.210:8081)..." echo "------------------------------------------------------" RESPONSE1=$(curl -s -d "๐Ÿ  Local ntfy test from $(hostname) at $(date)" http://192.168.0.210:8081/updates) if echo "$RESPONSE1" | grep -q '"id"'; then echo "โœ… Local ntfy server (IP) - SUCCESS" echo " Response: $(echo "$RESPONSE1" | jq -r '.id')" else echo "โŒ Local ntfy server (IP) - FAILED" echo " Response: $RESPONSE1" fi echo # Test local ntfy server (localhost) echo "๐Ÿ“ก Testing Local ntfy Server (localhost:8081)..." echo "-------------------------------------------------" RESPONSE2=$(curl -s -d "๐Ÿ  Localhost ntfy test from $(hostname) at $(date)" http://localhost:8081/updates) if echo "$RESPONSE2" | grep -q '"id"'; then echo "โœ… Local ntfy server (localhost) - SUCCESS" echo " Response: $(echo "$RESPONSE2" | jq -r '.id')" else echo "โŒ Local ntfy server (localhost) - FAILED" echo " Response: $RESPONSE2" fi echo # Test external ntfy server echo "๐ŸŒ Testing External ntfy Server (ntfy.vish.gg)..." echo "-------------------------------------------------" RESPONSE3=$(curl -s -d "๐ŸŒ External ntfy test from $(hostname) at $(date)" https://ntfy.vish.gg/REDACTED_NTFY_TOPIC) if echo "$RESPONSE3" | grep -q '"id"'; then echo "โœ… External ntfy server - SUCCESS" echo " Response: $(echo "$RESPONSE3" | jq -r '.id')" else echo "โŒ External ntfy server - FAILED" echo " Response: $RESPONSE3" fi echo echo "๐Ÿ“‹ Summary:" echo "----------" echo "Local ntfy (IP): http://192.168.0.210:8081/updates" echo "Local ntfy (localhost): http://localhost:8081/updates" echo "External ntfy: https://ntfy.vish.gg/REDACTED_NTFY_TOPIC" echo echo "๐Ÿ”ง Watchtower Configuration Options:" echo "------------------------------------" echo "Option 1 (Local IP): WATCHTOWER_NOTIFICATION_URL=http://192.168.0.210:8081/updates" echo "Option 2 (Localhost): WATCHTOWER_NOTIFICATION_URL=http://localhost:8081/updates" echo "Option 3 (External): WATCHTOWER_NOTIFICATION_URL=https://ntfy.vish.gg/REDACTED_NTFY_TOPIC" echo echo "๐Ÿ’ก Recommendation:" echo " - Use localhost for better reliability (no network dependency)" echo " - Use external for notifications REDACTED_APP_PASSWORD network" echo " - Consider using both (comma-separated) for redundancy" echo echo "โœ… ntfy notification test complete!"