Files
quectel-rgmii-toolkit/ipk-source/sdxpinn-quecmanager-beta/root/www/cgi-bin/quecmanager/advance/fetch_commands.sh
Cameron Thompson 8e80ba5c91 Final edits
- Make all cgi-bin and init files executable

- Move NTP contribution fix from package --> to be appart of sdxpinn-patch

- Edited ntp fi location

- Added additional service triggers to primary service quecmanager-services
2025-03-11 23:39:06 -04:00

26 lines
596 B
Bash
Executable File

#!/bin/sh
# Set content type for JSON response
echo "Content-Type: application/json"
echo ""
# Check if the file exists
if [ -f "/etc/config/atcommands.user" ]; then
# Start JSON object
printf "{\n"
awk -F';' '
BEGIN { first = 1 }
{
gsub(/\r/, "", $0)
if (!first) printf ",\n "
else printf " "
gsub(/"/, "\\\"", $1)
gsub(/"/, "\\\"", $2)
printf "\"%s\": \"%s\"", $1, $2
first = 0
}
' /etc/config/atcommands.user
printf "\n}"
else
echo '{"error": "No Data"}'
fi