2006-09-12 21:33:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-10-28 01:45:43 +00:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
export PYTHONPATH=..
|
2020-01-10 12:28:20 +00:00
|
|
|
export PATH="../bin:$PATH"
|
2014-10-28 01:45:43 +00:00
|
|
|
|
2020-01-10 12:28:20 +00:00
|
|
|
f2bversion=$(fail2ban-client -V)
|
|
|
|
echo "Generating man for $f2bversion ..."
|
2018-01-22 04:25:26 +00:00
|
|
|
|
2006-09-12 21:59:32 +00:00
|
|
|
# fail2ban-client
|
2006-09-28 19:37:18 +00:00
|
|
|
echo -n "Generating fail2ban-client "
|
2020-01-10 12:28:20 +00:00
|
|
|
help2man --section=1 --no-info --include=fail2ban-client.h2m --output fail2ban-client.1 fail2ban-client
|
2006-09-28 19:37:18 +00:00
|
|
|
echo "[done]"
|
|
|
|
echo -n "Patching fail2ban-client "
|
2006-11-18 15:12:22 +00:00
|
|
|
# Changes the title.
|
2006-09-12 21:59:32 +00:00
|
|
|
sed -i -e 's/.SS "Command:"/.SH COMMAND/' fail2ban-client.1
|
2006-11-18 15:12:22 +00:00
|
|
|
# Sets bold font for commands.
|
|
|
|
IFS="
|
|
|
|
"
|
|
|
|
NEXT=0
|
|
|
|
FOUND=0
|
|
|
|
LINES=$( cat fail2ban-client.1 )
|
|
|
|
echo -n "" > fail2ban-client.1
|
|
|
|
for LINE in $LINES; do
|
|
|
|
if [ "$LINE" = ".SH COMMAND" ]; then
|
|
|
|
FOUND=1
|
|
|
|
fi
|
|
|
|
if [ $NEXT -eq 1 ] && [ $FOUND -eq 1 ]; then
|
|
|
|
echo "\fB$LINE\fR" >> fail2ban-client.1
|
|
|
|
else
|
|
|
|
echo "$LINE" >> fail2ban-client.1
|
|
|
|
fi
|
|
|
|
if [ "$LINE" = ".TP" ]; then
|
|
|
|
NEXT=1
|
|
|
|
else
|
|
|
|
NEXT=0
|
|
|
|
fi
|
|
|
|
done
|
2006-09-28 19:37:18 +00:00
|
|
|
echo "[done]"
|
2006-09-12 21:59:32 +00:00
|
|
|
|
2018-01-22 04:25:26 +00:00
|
|
|
# fail2ban-python
|
|
|
|
echo -n "Generating fail2ban-python "
|
2020-01-10 12:28:20 +00:00
|
|
|
help2man --version-string=$f2bversion --section=1 --no-info --include=fail2ban-python.h2m --output fail2ban-python.1 fail2ban-python
|
2018-01-22 04:25:26 +00:00
|
|
|
echo "[done]"
|
|
|
|
|
2006-09-12 21:59:32 +00:00
|
|
|
# fail2ban-server
|
2006-09-28 19:37:18 +00:00
|
|
|
echo -n "Generating fail2ban-server "
|
2020-01-10 12:28:20 +00:00
|
|
|
help2man --section=1 --no-info --include=fail2ban-server.h2m --output fail2ban-server.1 fail2ban-server
|
2006-09-28 19:37:18 +00:00
|
|
|
echo "[done]"
|
2006-09-12 21:33:00 +00:00
|
|
|
|
2015-07-06 01:46:39 +00:00
|
|
|
# fail2ban-testcases
|
|
|
|
echo -n "Generating fail2ban-testcases "
|
2020-01-10 12:28:20 +00:00
|
|
|
help2man --section=1 --no-info --include=fail2ban-testcases.h2m --output fail2ban-testcases.1 fail2ban-testcases
|
2015-07-06 01:46:39 +00:00
|
|
|
echo "[done]"
|
|
|
|
|
2006-10-01 21:20:42 +00:00
|
|
|
# fail2ban-regex
|
2006-11-01 22:13:44 +00:00
|
|
|
echo -n "Generating fail2ban-regex "
|
2020-01-10 12:28:20 +00:00
|
|
|
help2man --section=1 --no-info --include=fail2ban-regex.h2m --output fail2ban-regex.1 fail2ban-regex
|
2006-10-01 21:20:42 +00:00
|
|
|
echo "[done]"
|
2007-01-21 22:21:13 +00:00
|
|
|
echo -n "Patching fail2ban-regex "
|
|
|
|
# Changes the title.
|
|
|
|
sed -i -e 's/.SS "Log:"/.SH LOG/' fail2ban-regex.1
|
|
|
|
sed -i -e 's/.SS "Regex:"/.SH REGEX/' fail2ban-regex.1
|
|
|
|
# Sets bold font for commands.
|
|
|
|
IFS="
|
|
|
|
"
|
|
|
|
NEXT=0
|
|
|
|
FOUND=0
|
|
|
|
LINES=$( cat fail2ban-regex.1 )
|
|
|
|
echo -n "" > fail2ban-regex.1
|
|
|
|
for LINE in $LINES; do
|
|
|
|
if [ "$LINE" = ".SH LOG" ]; then
|
|
|
|
FOUND=1
|
|
|
|
fi
|
|
|
|
if [ $NEXT -eq 1 ] && [ $FOUND -eq 1 ]; then
|
|
|
|
echo "\fB$LINE\fR" >> fail2ban-regex.1
|
|
|
|
else
|
|
|
|
echo "$LINE" >> fail2ban-regex.1
|
|
|
|
fi
|
|
|
|
if [ "$LINE" = ".TP" ]; then
|
|
|
|
NEXT=1
|
|
|
|
else
|
|
|
|
NEXT=0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo "[done]"
|