-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttip-rc.local
executable file
·49 lines (40 loc) · 1.05 KB
/
ttip-rc.local
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/sbin:/usr/sbin:$PATH
ipset create sshguard4 hash:net
#iptables -A INPUT -p tcp --dport 22 -m set --match-set sshguard4 src -j DROP
iptables-restore -w 1 < /etc/iptables.rules
#ethtool -K eth0 tso off gso off
#ethtool -K eth0 gro on gso on tso on
#modprobe crc32test
#rmmod crc32test
dd=/home/mator/dmesg
kernv=`uname -r`
dmesgf=dmesg-${kernv}
conf=config-${kernv}
procconf=/proc/config.gz
if [ ! -f ${dd}/${dmesgf} ]; then
if [ -d $dd ]; then
dmesg > ${dd}/${dmesgf}
if [ -f $procconf ]; then
[ ! -f ${dd}/${conf}.gz ] && cp $procconf ${dd}/${conf}.gz
else
echo "no $procconf"
fi
fi
fi
auditctl -e 0 > /dev/null
# lock kernel source files in mem
kerneldir=/1/mator/linux-2.6
[ -d $kerneldir ] && vmtouch -I '*.c' -I '*.h' -d -l $kerneldir
exit 0