mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 10:51:55 +00:00
The python3-pkg-resources package does not exist in OpenWrt. The only distutils/setuptools usage in fail2ban 1.1.0 is in filterpyinotify.py and filtersystemd.py, both of which are optional backends not available on OpenWrt. They are loaded lazily via ImportError-guarded calls and the default auto backend falls through to polling without them. Also add test.sh with basic import and CLI smoke test. Add me as maintainer. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
24 lines
592 B
Bash
Executable File
24 lines
592 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = fail2ban ] || exit 0
|
|
|
|
# Verify fail2ban-client binary is present and functional
|
|
fail2ban-client --version 2>&1 | grep -qi "fail2ban" || \
|
|
{ echo "fail2ban-client --version did not produce expected output"; exit 1; }
|
|
|
|
python3 - << 'EOF'
|
|
import fail2ban
|
|
|
|
from fail2ban.version import version
|
|
assert version, "fail2ban version is empty"
|
|
|
|
from fail2ban.helpers import formatExceptionInfo
|
|
from fail2ban.exceptions import UnknownJailException
|
|
|
|
# Verify core exception class is accessible
|
|
try:
|
|
raise UnknownJailException("test")
|
|
except UnknownJailException:
|
|
pass
|
|
EOF
|