secubox-openwrt/package/secubox/secubox-localrecall/files/etc/init.d/localrecall
CyberMind-FR d92b3360ea feat(repo): Add unified repo-deploy.sh and multi-arch support
- Add repo-deploy.sh script for staging and deploying packages
- Replicate _all.ipk packages to all 6 architectures automatically
- Add "Refresh Indexes" button to LuCI dashboard for local deployments
- Add RPCD refresh method to regenerate Packages indexes on-device
- Support architectures: aarch64_cortex-a72, aarch64_cortex-a53,
  aarch64_generic, x86_64, mips_24kc, mipsel_24kc

Usage:
  ./secubox-tools/repo-deploy.sh stage --clean
  ./secubox-tools/repo-deploy.sh deploy root@192.168.255.1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-19 07:48:59 +01:00

46 lines
1.0 KiB
Bash
Executable File

#!/bin/sh /etc/rc.common
# LocalRecall Memory Cleanup Daemon
START=99
STOP=10
USE_PROCD=1
CONFIG="localrecall"
start_service() {
local enabled auto_cleanup cleanup_hour
config_load "$CONFIG"
config_get enabled main enabled 0
config_get auto_cleanup cleanup auto_cleanup 1
config_get cleanup_hour cleanup cleanup_hour 3
[ "$enabled" = "1" ] || return 0
[ "$auto_cleanup" = "1" ] || return 0
# Schedule daily cleanup via cron instead of daemon
# This is more efficient for periodic tasks
local cron_entry="0 $cleanup_hour * * * /usr/bin/localrecallctl cleanup -q"
# Add to crontab if not present
if ! grep -q "localrecallctl cleanup" /etc/crontabs/root 2>/dev/null; then
echo "$cron_entry" >> /etc/crontabs/root
/etc/init.d/cron restart 2>/dev/null
fi
# Initialize storage
mkdir -p /var/lib/localrecall
}
stop_service() {
# Remove from crontab
if [ -f /etc/crontabs/root ]; then
sed -i '/localrecallctl cleanup/d' /etc/crontabs/root
/etc/init.d/cron restart 2>/dev/null
fi
}
service_triggers() {
procd_add_reload_trigger "$CONFIG"
}