mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
@@ -0,0 +1,4 @@
|
||||
config snort 'snort'
|
||||
option config_dir '/etc/snort/etc/'
|
||||
option alert_module 'alert_syslog'
|
||||
option interface 'eth0'
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/bin/snort
|
||||
|
||||
validate_snort_section() {
|
||||
uci_validate_section snort snort "${1}" \
|
||||
'config_dir:string' \
|
||||
'alert_module:string' \
|
||||
'interface:string'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local config_file interface
|
||||
|
||||
validate_snort_section snort || {
|
||||
echo "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG -q --daq-dir /usr/lib/daq/ -i "$interface" -c "$config_dir/snort.lua" -A "$alert_module"
|
||||
procd_set_param env SNORT_LUA_PATH="$config_dir"
|
||||
procd_set_param file $CONFIGFILE
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
service_stop ${PROG}
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "snort"
|
||||
procd_add_validation validate_snort_section
|
||||
}
|
||||
Reference in New Issue
Block a user