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>
66 lines
1.7 KiB
Bash
Executable File
66 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "Content-type: application/json"
|
|
echo ""
|
|
|
|
# Initialize error flag
|
|
has_error=false
|
|
error_message=""
|
|
|
|
# Function to append to error message
|
|
append_error() {
|
|
if [ -z "$error_message" ]; then
|
|
error_message="$1"
|
|
else
|
|
error_message="$error_message; $1"
|
|
fi
|
|
has_error=true
|
|
}
|
|
|
|
# Remove the entire quecmanager directory
|
|
if [ -d "/etc/quecmanager/imei_profile/" ]; then
|
|
rm -rf /etc/quecmanager/imei_profile/
|
|
if [ $? -ne 0 ]; then
|
|
append_error "Failed to remove quecmanager directory"
|
|
fi
|
|
else
|
|
append_error "quecmanager directory not found"
|
|
fi
|
|
|
|
# Remove the line from rc.local
|
|
if [ -f "/etc/rc.local" ]; then
|
|
# Create a temporary file
|
|
temp_file=$(mktemp)
|
|
|
|
# Remove the imeiProfiles.sh line and copy to temp file
|
|
sed '/\/etc\/quecmanager\/imeiProfiles.sh/d' /etc/rc.local > "$temp_file"
|
|
|
|
# Check if sed command was successful
|
|
if [ $? -eq 0 ]; then
|
|
# Replace original file with modified version
|
|
mv "$temp_file" /etc/rc.local
|
|
if [ $? -ne 0 ]; then
|
|
append_error "Failed to update rc.local"
|
|
fi
|
|
else
|
|
append_error "Failed to modify rc.local"
|
|
rm -f "$temp_file"
|
|
fi
|
|
else
|
|
append_error "rc.local file not found"
|
|
fi
|
|
|
|
# Remove temporary files that might have been created
|
|
rm -f /tmp/imei_result.txt
|
|
rm -f /tmp/debug.log
|
|
rm -f /tmp/inputICCID.txt
|
|
rm -f /tmp/outputICCID.txt
|
|
rm -f /tmp/inputIMEI.txt
|
|
rm -f /tmp/outputIMEI.txt
|
|
|
|
# Return appropriate JSON response
|
|
if [ "$has_error" = true ]; then
|
|
echo "{\"status\": \"error\", \"message\": \"$error_message\"}"
|
|
else
|
|
echo "{\"status\": \"success\", \"message\": \"IMEI profiles and configuration successfully removed\"}"
|
|
fi |