Release Notes: Enhanced Web App Architecture: - Optimized the structure for better scalability and maintainability. - Refined Data Fetching Logic: Improved the efficiency and reliability of data retrieval processes. - Optimized AT Terminal: Enhanced functionality for smoother interaction with AT commands. - Revamped UI/UX Design: Streamlined user interface and experience for improved accessibility and usability. New Features: - MTU Settings: Added customizable Maximum Transmission Unit (MTU) settings. - APN and IMEI Profiles: Introduced the ability to configure APN and IMEI profiles for better device management. - Persistent Cell Locking: Added native support for persistent cell locking, ensuring consistent network connections. - QuecWatch: Connection monitoring with auto reconnect and reboot settable Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
45 lines
1.2 KiB
Bash
Executable File
45 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "Content-type: application/json"
|
|
echo ""
|
|
|
|
CONFIG_FILE="/etc/quecmanager/apn_profile/apn_config.txt"
|
|
|
|
if [ ! -f "$CONFIG_FILE" ]; then
|
|
echo "{}"
|
|
exit 0
|
|
fi
|
|
|
|
# Read the configuration file
|
|
iccidProfile1=$(grep "^iccidProfile1=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
apnProfile1=$(grep "^apnProfile1=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
pdpType1=$(grep "^pdpType1=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
iccidProfile2=$(grep "^iccidProfile2=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
apnProfile2=$(grep "^apnProfile2=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
pdpType2=$(grep "^pdpType2=" "$CONFIG_FILE" | cut -d'=' -f2)
|
|
|
|
# Build the JSON response
|
|
echo "{"
|
|
|
|
# Add Profile 1 if it exists
|
|
if [ -n "$iccidProfile1" ]; then
|
|
echo " \"profile1\": {"
|
|
echo " \"iccid\": \"$iccidProfile1\","
|
|
echo " \"apn\": \"$apnProfile1\","
|
|
echo " \"pdpType\": \"$pdpType1\""
|
|
echo " }"
|
|
|
|
# Add comma if Profile 2 exists
|
|
[ -n "$iccidProfile2" ] && echo " ,"
|
|
fi
|
|
|
|
# Add Profile 2 if it exists
|
|
if [ -n "$iccidProfile2" ]; then
|
|
echo " \"profile2\": {"
|
|
echo " \"iccid\": \"$iccidProfile2\","
|
|
echo " \"apn\": \"$apnProfile2\","
|
|
echo " \"pdpType\": \"$pdpType2\""
|
|
echo " }"
|
|
fi
|
|
|
|
echo "}" |