Update socat-bridge and QuecManager
Created quecmanager services Removed SMS for now Updated socat start priority and add smd7 as an option
This commit is contained in:
25
ipk-source/sdxpinn-quecmanager-beta/root/etc/init.d/quecmanager-services
Executable file
25
ipk-source/sdxpinn-quecmanager-beta/root/etc/init.d/quecmanager-services
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=49
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
echo "Starting QuecManager services"
|
||||
echo "Starting Signal Metrics Logger"
|
||||
# Start Signal Metrics Logger
|
||||
procd_open_instance
|
||||
procd_set_param command /www/cgi-bin/services/log_signal_metrics.sh
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
echo "Signal Metrics Logger Running"
|
||||
echo "All QuecManager services Running"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
# procd will handle stopping all instances automatically
|
||||
echo "Stopping QuecManager services."
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Script for SMS initialization and initial fetch
|
||||
# Check if atinout and jq are installed
|
||||
if ! command -v atinout &> /dev/null || ! command -v jq &> /dev/null; then
|
||||
echo "Error: Required tools (atinout or jq) are not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the device exists
|
||||
if [ ! -c "/dev/smd7" ]; then
|
||||
echo "Error: Device /dev/smd7 not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set SMS text mode
|
||||
if ! echo "AT+CMGF=1" | atinout - /dev/smd7 -; then
|
||||
echo "Error: Failed to set SMS text mode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for 2 seconds
|
||||
sleep 2
|
||||
|
||||
# Fetch initial SMS messages
|
||||
if ! echo "AT+CMGL=\"ALL\"" | atinout - /dev/smd7 - | jq -R -s '
|
||||
split("\n") |
|
||||
map(select(length > 0)) |
|
||||
map(
|
||||
select(startswith("+CMGL:") or (. != "OK" and . != "ERROR"))
|
||||
) |
|
||||
{messages: .}
|
||||
' > /tmp/sms_inbox.json; then
|
||||
echo "Error: Failed to fetch SMS messages"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Exit successfully
|
||||
exit 0
|
||||
Reference in New Issue
Block a user