summarylogtreecommitdiffstats
path: root/pulledpork_update.sh
blob: d1bcd1535d7605f3f542f5f61ce40348233959e5 (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 is-active snort &>/dev/null
then
	systemctl restart snort
fi

# restart suricata
if systemctl is-active suricata &>/dev/null
then
	systemctl restart suricata
fi

# restart barnyard2
if systemctl is-active barnyard2 &>/dev/null
then
	systemctl restart barnyard2
fi