Files
quectel-rgmii-toolkit/ipk-source/sdxpinn-quecmanager/root/www/cgi-bin/cell-locking/fetch-cell-lock.sh
Cameron Thompson b5c7bfe567 Update Packages
- Updated QuecManager to 0.0.3 include patch from c8faf539c1

- Added LAN settings to sdxpinn-console-menu V0.0.2

- Updated Tailscale ipks from 1.74.1 to 1.76.1
2024-10-30 02:07:11 +00:00

60 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
echo "Content-type: application/json"
echo ""
CONFIG_FILE="/etc/quecmanager/cell_lock_config.txt"
if [ ! -f "$CONFIG_FILE" ]; then
echo '{"status": "error", "message": "No cell lock configurations found", "configurations": {}}'
exit 0
fi
# Function to read config values
get_config_value() {
local key=$1
local value=$(grep "^$key=" "$CONFIG_FILE" | sed "s/^$key=//")
# Remove any trailing whitespace or comments
value=$(echo "$value" | sed 's/[[:space:]]*#.*$//' | sed 's/[[:space:]]*$//')
echo "$value"
}
# Read LTE configuration values
earfcn1=$(get_config_value "earfcn1")
pci1=$(get_config_value "pci1")
earfcn2=$(get_config_value "earfcn2")
pci2=$(get_config_value "pci2")
earfcn3=$(get_config_value "earfcn3")
pci3=$(get_config_value "pci3")
# Read 5G-SA configuration values
nrarfcn=$(get_config_value "nrarfcn")
nrpci=$(get_config_value "nrpci")
scs=$(get_config_value "scs")
band=$(get_config_value "band")
# Debug output to syslog
logger "fetch-cell-lock: earfcn1=$earfcn1 pci1=$pci1 nrarfcn=$nrarfcn nrpci=$nrpci"
# Construct JSON response
cat << EOF
{
"status": "success",
"configurations": {
"lte": {
"earfcn1": "${earfcn1:-}",
"pci1": "${pci1:-}",
"earfcn2": "${earfcn2:-}",
"pci2": "${pci2:-}",
"earfcn3": "${earfcn3:-}",
"pci3": "${pci3:-}"
},
"sa": {
"nrarfcn": "${nrarfcn:-}",
"nrpci": "${nrpci:-}",
"scs": "${scs:-}",
"band": "${band:-}"
}
}
}
EOF