summarylogtreecommitdiffstats
path: root/pulledpork_update.sh
blob: 7dfb64aa9532a94448a3c969d5630766bfa0849d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

if [ -z "$1" ]
then 
	echo "You must provide rule file path."
	exit 0
fi

if [ ! -f "$1" ]
then
	echo "Rule file $1 missing."
	exit 0
fi

# ulimit is needed as sometimes pulledpork.pl goes in infinite loop
( ulimit -t 60; /usr/bin/pulledpork.pl -P -c /etc/pulledpork/pulledpork.conf )

# restart snort
if systemctl -q is-active snort.service &>/dev/null
then
	systemctl -q try-restart snort.service
fi

# restart suricata
if systemctl -q is-active suricata.service &>/dev/null
then
	systemctl -q try-restart suricata.service
fi

# restart barnyard2
if systemctl -q is-active barnyard2.service &>/dev/null
then
	systemctl -q try-restart barnyard2.service
fi