Browse Source

Merge pull request #8119 from jefferyto/snort-init

snort: Update init script
lilik-openwrt-22.03
Rosen Penev 6 years ago
committed by GitHub
parent
commit
41e005c7b4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      net/snort/files/snort.init

+ 9
- 6
net/snort/files/snort.init View File

@ -8,26 +8,29 @@ USE_PROCD=1
PROG=/usr/bin/snort
validate_snort_section() {
uci_validate_section snort snort "${1}" \
uci_load_validate snort snort "$1" "$2" \
'config_file:string' \
'interface:string'
}
start_service() {
local config_file interface
validate_snort_section snort || {
start_snort_instance() {
[ "$2" = 0 ] || {
echo "validation failed"
return 1
}
procd_open_instance
procd_set_param command $PROG "-q" "--daq-dir" "/usr/lib/daq/" "-i" "$interface" "-c" "$config_file" "-s" "-N"
procd_set_param file $CONFIGFILE
procd_set_param file $config_file
procd_set_param respawn
procd_close_instance
}
start_service()
{
validate_snort_section snort start_snort_instance
}
stop_service()
{
service_stop ${PROG}


Loading…
Cancel
Save