-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
49 lines (34 loc) · 1.21 KB
/
install.sh
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/bash
echo "-------------------------------------"
echo "IPTables Firewall Script Installation"
echo "-------------------------------------"
echo "Copying firewall.start to systemd"
cp firewall.service /etc/systemd/system/
echo "Making /etc/firewall/ directory"
if [ ! -d /etc/firewall ]; then
mkdir -p /etc/firewall;
fi
echo "Copying firewall.stop to /etc/firewall/"
cp firewall.stop /etc/firewall/
echo "Copying firewall.sh to /etc/firewall/"
cp firewall.sh /etc/firewall/
echo "Enabling the systemd firewall.service at boot"
systemctl enable firewall
sleep 3
echo "Starting the systemd firewall.service"
systemctl start firewall
echo "Finished installation of IPTables Firewall"
echo "-------------------------------------"
echo "IPTables Logging Config Setup "
echo "-------------------------------------"
echo "Making /var/log/iptables directory"
if [ ! -d /var/log/iptables ]; then
mkdir -p /var/log/iptables;
fi
echo "Setting /var/log/iptables ownership"
chown syslog:adm /var/log/iptables
echo "Copying 10-iptables.conf to /etc/rsyslog.d/"
cp 10-iptables.conf /etc/rsyslog.d
echo "Restarting rsyslog.d Service"
systemctl restart rsyslog.service
echo "Finished installation of IPTables Logging"