Update F2B wrapper to show possible errors with IPTables (#2170)

This commit is contained in:
Georg Lauterbach 2021-09-06 11:39:50 +02:00 committed by GitHub
parent e89ea3110f
commit 317f3e41c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,24 @@
# shellcheck source=../scripts/helper-functions.sh
. /usr/local/bin/helper-functions.sh
if ! IPTABLES_OUTPUT=$(iptables -L 2>&1)
then
echo "IPTables is not functioning correctly. The output of \`iptables -L\` was:
${IPTABLES_OUTPUT}
Possible causes for this error are
1. Missing capabilities (you need CAP_NET_RAW & CAP_NET_ADMIN, see \`capsh --print\`)
2. Modifications caused by user-patches.sh
3. Host is configured incorrectly
Aborting...
"
exit 1
fi
function usage { echo "Usage: ${0} [<unban> <ip-address>]" ; }
unset JAILS