Added nftables fix

This commit is contained in:
Alexey Berezhok
2024-07-04 23:01:04 +03:00
parent 719c7d9d67
commit 7444ae626d
4 changed files with 37 additions and 14 deletions

View File

@@ -46,18 +46,26 @@ if [ ! -e "$rules" ]; then
exit
fi
# Checking conntrack module avaiabilty
$modprobe nf_conntrack > /dev/null 2>&1
if [ $? -ne 0 ]; then
$sysctl net.netfilter.nf_conntrack_max > /dev/null 2>&1
if [ -f /etc/redhat-release ]; then
conntrack='yes'
else
# Checking conntrack module avaiabilty
$modprobe nf_conntrack > /dev/null 2>&1
if [ $? -ne 0 ]; then
conntrack='no'
$sysctl net.netfilter.nf_conntrack_max > /dev/null 2>&1
if [ $? -ne 0 ]; then
conntrack='no'
fi
fi
fi
$modprobe nf_conntrack_ftp > /dev/null 2>&1
if [ $? -ne 0 ]; then
conntrack_ftp='no'
if [ -f /etc/redhat-release ]; then
conntrack_ftp='yes'
else
$modprobe nf_conntrack_ftp > /dev/null 2>&1
if [ $? -ne 0 ]; then
conntrack_ftp='no'
fi
fi
# Checking custom OpenSSH port