Added fix for memory fetching initialization
This commit is contained in:
@@ -53,8 +53,31 @@ start_service() {
|
||||
procd_close_instance
|
||||
echo "Ping Daemon started"
|
||||
|
||||
# Memory daemon is now managed dynamically by memory_settings.sh
|
||||
# It will be added/removed from this file automatically based on user configuration
|
||||
# Start memory daemon if enabled in configuration
|
||||
CONFIG_FILE="/etc/quecmanager/settings/memory_settings.conf"
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
# More robust parsing for OpenWrt/BusyBox
|
||||
MEMORY_ENABLED=$(awk -F'=' '/^MEMORY_ENABLED=/ {print $2}' "$CONFIG_FILE" 2>/dev/null | tr -d '"' | tr -d ' ')
|
||||
echo "Memory config found. MEMORY_ENABLED='$MEMORY_ENABLED'"
|
||||
|
||||
case "$MEMORY_ENABLED" in
|
||||
true|1|on|yes|enabled)
|
||||
echo "Starting Memory Daemon..."
|
||||
procd_open_instance
|
||||
procd_set_param command /www/cgi-bin/services/memory_daemon.sh
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
echo "Memory Daemon started"
|
||||
;;
|
||||
*)
|
||||
echo "Memory Daemon disabled in configuration (value: '$MEMORY_ENABLED')"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "Memory configuration not found at $CONFIG_FILE, skipping Memory Daemon"
|
||||
fi
|
||||
|
||||
echo "All QuecManager services Started"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user