Build sdxpinn-quecmanger ipk
-Removed no longer needed files -Created ipk for quecmanager -Thank you @dr-dolomite for your hard work on this! Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Content-type: application/json"
|
||||
echo ""
|
||||
|
||||
CONFIG_FILE="/etc/quecmanager/apn_config.txt"
|
||||
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo '{"status": "error", "message": "No APN profiles found", "profiles": {}}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Function to read config values
|
||||
get_config_value() {
|
||||
local key=$1
|
||||
local value=$(grep "^${key}=" "$CONFIG_FILE" | cut -d'=' -f2)
|
||||
echo "$value"
|
||||
}
|
||||
|
||||
# Read all profile values
|
||||
iccidProfile1=$(get_config_value "iccidProfile1")
|
||||
apnProfile1=$(get_config_value "apnProfile1")
|
||||
pdpType1=$(get_config_value "pdpType1")
|
||||
iccidProfile2=$(get_config_value "iccidProfile2")
|
||||
apnProfile2=$(get_config_value "apnProfile2")
|
||||
pdpType2=$(get_config_value "pdpType2")
|
||||
|
||||
# Construct JSON response
|
||||
cat << EOF
|
||||
{
|
||||
"status": "success",
|
||||
"profiles": {
|
||||
"profile1": {
|
||||
"iccid": "${iccidProfile1:-}",
|
||||
"apn": "${apnProfile1:-}",
|
||||
"pdpType": "${pdpType1:-}"
|
||||
},
|
||||
"profile2": {
|
||||
"iccid": "${iccidProfile2:-}",
|
||||
"apn": "${apnProfile2:-}",
|
||||
"pdpType": "${pdpType2:-}"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
Reference in New Issue
Block a user