mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 18:57:35 +04:00
Remove the quiet mode flag (-q) from grep in version check commands to ensure that their stdout output is visible. While at it, switch the remaining regex matches (perl, sscep, awscli) to fixed-string matching where appropriate, so that special characters in the version string are matched literally. For libzip, the zipcmp and zipmerge branches ran grep and then unconditionally exited 0, so a version mismatch was never reported and the version check override always passed. Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
24 lines
591 B
Bash
Executable File
24 lines
591 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = fail2ban ] || exit 0
|
|
|
|
# Verify fail2ban-client binary is present and functional
|
|
fail2ban-client --version 2>&1 | grep -i "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
|