#!/bin/sh ######################################################################## # Begin $rc_base/init.d/suricata # # Description : Suricata Initscript # # Author : Stefan Schantl # # Version : 01.00 # # Notes : # ######################################################################## . /etc/sysconfig/rc . ${rc_functions} PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin; export PATH eval $(/usr/local/bin/readhash /var/ipfire/suricata/settings) # Name of the firewall chain. FW_CHAIN="IPS" # Optional options for the Netfilter queue. NFQ_OPTS="--queue-bypass " # Array containing the 4 possible network zones. network_zones=( red green blue orange ) # Mark and Mask options. MARK="0x2" MASK="0x2" # PID file of suricata. PID_FILE="/var/run/suricata.pid" case "$1" in start) # Get amount of CPU cores. NFQUEUES= CPUCOUNT=0 while read line; do [ "$line" ] && [ -z "${line%processor*}" ] && NFQUEUES+="-q $CPUCOUNT " && ((CPUCOUNT++)) done /dev/null 2>/dev/null # Don't report returncode of rm if suricata was not started exit 0 ;; status) statusproc /usr/bin/suricata ;; restart) $0 stop $0 start ;; reload) # Send SIGUSR2 to the suricata process to perform a reload # of the ruleset. kill -USR2 $(pidof suricata) ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 ;; esac chmod 644 /var/log/suricata/* 2>/dev/null # End $rc_base/init.d/suricata