webui-new/development/simpleadmin/www/cgi-bin/get_watchcat_status

18 lines
464 B
Plaintext
Raw Permalink Normal View History

2025-03-24 22:39:52 +08:00
#!/bin/bash
# Content type header
echo "Content-type: application/json"
echo ""
# This script fetches the watchCat parameters from the /tmp/watchcat.json and returns it as JSON
# Example content of /tmp/watchcat:
# {"watchcat": {"enabled": true, "track_ip": "1.1.1.1", "ping_timeout": 30, "ping_failure_count": 10}}
# Check if the file exists
if [ -f /tmp/watchcat.json ]; then
cat /tmp/watchcat.json
else
# return an empty JSON object
echo "{}"
fi