Reapply "Merge branch 'development-SDXPINN' into SDXPINN"

This reverts commit 738567acd7.
This commit is contained in:
Cameron Thompson
2025-08-28 17:42:45 -04:00
parent 738567acd7
commit e125cc1461
130 changed files with 927 additions and 568 deletions

View File

@@ -8,14 +8,17 @@ set -eu
# Ensure PATH for OpenWrt/BusyBox
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Load centralized logging
. /www/cgi-bin/services/quecmanager_logger.sh
# Configuration
TMP_DIR="/tmp/quecmanager"
OUT_JSON="$TMP_DIR/memory.json"
PID_FILE="$TMP_DIR/memory_daemon.pid"
LOG_FILE="$TMP_DIR/memory_daemon.log"
CONFIG_FILE="/etc/quecmanager/settings/memory_settings.conf"
[ -f "$CONFIG_FILE" ] || CONFIG_FILE="/tmp/quecmanager/settings/memory_settings.conf"
DEFAULT_INTERVAL=1
SCRIPT_NAME="memory_daemon"
# Ensure temp directory exists
ensure_tmp_dir() {
@@ -24,7 +27,7 @@ ensure_tmp_dir() {
# Logging function
log() {
printf '%s - %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$1" >> "$LOG_FILE" 2>/dev/null || true
qm_log_info "daemon" "$SCRIPT_NAME" "$1"
}
# Check if this daemon instance is already running