- 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>
69 lines
1.3 KiB
Bash
Executable File
69 lines
1.3 KiB
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
# SecuBox DNS Guard - AI-powered DNS anomaly detection
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
NAME="dns-guard"
|
|
PROG="/usr/bin/dns-guard"
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load dns-guard
|
|
config_get enabled main enabled 0
|
|
|
|
[ "$enabled" != "1" ] && {
|
|
logger -t "$NAME" "Service disabled in config"
|
|
return 0
|
|
}
|
|
|
|
# Ensure dnsmasq logging is enabled
|
|
ensure_dnsmasq_logging
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" daemon
|
|
procd_set_param respawn
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param pidfile /var/run/${NAME}.pid
|
|
procd_close_instance
|
|
|
|
logger -t "$NAME" "Started DNS Guard daemon"
|
|
}
|
|
|
|
stop_service() {
|
|
logger -t "$NAME" "Stopped DNS Guard daemon"
|
|
}
|
|
|
|
reload_service() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "dns-guard"
|
|
}
|
|
|
|
ensure_dnsmasq_logging() {
|
|
# Check if dnsmasq query logging is enabled
|
|
local log_queries=$(uci -q get dhcp.@dnsmasq[0].logqueries)
|
|
local log_facility=$(uci -q get dhcp.@dnsmasq[0].logfacility)
|
|
|
|
if [ "$log_queries" != "1" ]; then
|
|
logger -t "$NAME" "Enabling dnsmasq query logging for DNS Guard"
|
|
uci set dhcp.@dnsmasq[0].logqueries='1'
|
|
uci set dhcp.@dnsmasq[0].logfacility='/var/log/dnsmasq.log'
|
|
uci commit dhcp
|
|
/etc/init.d/dnsmasq restart
|
|
fi
|
|
}
|
|
|
|
status() {
|
|
"$PROG" status
|
|
}
|
|
|
|
boot() {
|
|
start
|
|
}
|