- 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>
52 lines
1.0 KiB
Bash
Executable File
52 lines
1.0 KiB
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
# Wazuh Agent init script for SecuBox
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
WAZUH_DIR="/var/ossec"
|
|
WAZUH_BIN="$WAZUH_DIR/bin/wazuh-agentd"
|
|
WAZUH_CONTROL="$WAZUH_DIR/bin/wazuh-control"
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load wazuh
|
|
config_get enabled main enabled '0'
|
|
|
|
[ "$enabled" != "1" ] && return 0
|
|
|
|
# Check if agent is installed
|
|
[ ! -x "$WAZUH_CONTROL" ] && {
|
|
logger -t wazuh "Wazuh agent not installed. Run: wazuhctl install"
|
|
return 1
|
|
}
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$WAZUH_CONTROL" start
|
|
procd_set_param respawn
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
|
|
logger -t wazuh "Wazuh agent started"
|
|
}
|
|
|
|
stop_service() {
|
|
[ -x "$WAZUH_CONTROL" ] && "$WAZUH_CONTROL" stop 2>/dev/null
|
|
logger -t wazuh "Wazuh agent stopped"
|
|
}
|
|
|
|
reload_service() {
|
|
[ -x "$WAZUH_CONTROL" ] && "$WAZUH_CONTROL" reload 2>/dev/null
|
|
logger -t wazuh "Wazuh agent reloaded"
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "wazuh"
|
|
}
|
|
|
|
status() {
|
|
[ -x "$WAZUH_CONTROL" ] && "$WAZUH_CONTROL" status
|
|
}
|