18 lines
464 B
Plaintext
18 lines
464 B
Plaintext
|
|
#!/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
|